home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 16031 < prev    next >
Encoding:
Text File  |  1992-11-10  |  1.1 KB  |  31 lines

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