home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!gumby!wupost!esds!aisun!jensen
- From: jensen@aisun.mdc.com (Paul Jensen)
- Subject: Re: Creating a directory
- Message-ID: <1992Nov5.153121.21545@esds.mdc.com>
- Sender: news@esds.mdc.com (user for external news)
- Organization: McDonnell Douglas Corporation, St. Louis
- References: <720495783snx@trmphrst.demon.co.uk> <1992Nov4.163818.23811@siesoft.co.uk>
- Date: Thu, 5 Nov 1992 15:31:21 GMT
- Lines: 19
-
- In article <1992Nov4.163818.23811@siesoft.co.uk> huw@siesoft.co.uk (Huw Roberts) writes:
- >nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
- >: In article <1992Oct27.161738.3863@cs.brown.edu> rbb@cs.brown.edu (Robert Baynes) writes:
- >: > I am writing a routine to create a directory.
- >: If you are using C++, look at streams.
- >
- >Indeed. I like this solution:
- >
- > ostrstream tmp;
- > tmp << path << '/' << IAID;
- > mkdir (tmp.str);
- >
- >(tmp will vanish on its own)
- >
- I think you mean mkdir(temp.str());
- and don't forget to "unfreeze" the dynamic buffer so it is deleted by
- calling tmp.rdbuf()->freeze(0); to allow the ostrstream destructor
- to free up the memory.
-
-