about fstream.open()

May 14, 2009 at 8:31am
when I use fstream.open("filename") to creat a file
if there is directory in the filename
such as out/example.txt
if there is no folder '/out/' in the same directory of the program
the open() will fail
so how to add a folder in the present directory?
thanks
May 14, 2009 at 9:04am
Directory operations are different from files. The operations vary between systems.

What operating System and compiler are you using?
May 14, 2009 at 9:58am
linux
I'm wondering if there any shortcut statement or function argument in fstream could achieve this goal
thanks
May 14, 2009 at 10:10am
int mkdir(const char* path, mode_t mode);

No, you cannot create a directory using the stream library.
May 14, 2009 at 1:49pm
thanks!
Topic archived. No new replies allowed.