i just want to know how to create folders using c++ code...i can make files usng iostream,but can folder?
i
Printable View
i just want to know how to create folders using c++ code...i can make files usng iostream,but can folder?
i
::CreateDirectory
Cheers
This would only work in Windows... ;)Quote:
Originally Posted by golanshahar
There is not platform-independent way of doing it...thus, you need to check what the C run-time or API of the correpsonding operating system has to offer...which one are you using?
i think that people working in unix/linux wouldnt ask that question ("folders":)Quote:
Originally Posted by Andreas Masur
thanks guys for replaying..
by the way i m using linux not windows...why would not linux users not ask that?!
i use mandrake 10.
Why? Aren't there folders in Linux? ;)Quote:
Originally Posted by l00p1n6
AFAIK, there should be a 'mkdir' function...Quote:
Originally Posted by deepinlife
There is relatively portable boost method create_directory.
no respectable *nix programmer would call them "folders". They are directories. :rolleyes:Quote:
Originally Posted by Andreas Masur
Well...I guess that I does not have that much respect for my *nix then (IOW, my directories can be folders if they want)... :eek:Quote:
Originally Posted by stober
Quote:
Originally Posted by golanshahar
Is ::CreateDirectory a Windows specific function? How to create directory using C++ on Linux?
Are there any C++ functions available (that create directory on Linux) written by someone who would like to share to others?
o/w; Is there a built-in C++ function that creates directory and will runs on Linux (no Windows specific stuff?
Thanks!
Windy
RoboTact has already given the answer. Use boost::filesystem and you'll have the bonus of having OS independent code.Quote:
Originally Posted by RoboTact
Andres also posted a function that is portable between *nix and MS-Windows -- mkdir().
i had to create directories in windows using VC++
I can get CreateDirectory to work only when the path is like " c:/face"
If I give "c:/face/images" it doesnt create the folder, not even face, any help would be appreciated.
if I have c:/face created then it creates ./image also :?