Elpezmuerto
Elpezmuerto

Reputation: 5571

Cross-platform compatible directory creation in C++

I need to dynamically create directory based on input filenames in C++ and it must be cross-platform compatible. I am also familiar with the boost library. The input to the directory creation function will be a string with the following prototype:

void createDirectory (std::string name)

Sample code would be much appreciated.

Upvotes: 1

Views: 2677

Answers (2)

rubenvb
rubenvb

Reputation: 76519

Without Boost (or other cross-platform framework like Qt, wxWidgets) or some future revision of the C++ sandard, you're out of luck.

You can use boost::filesystem.

Upvotes: 0

Georg Fritzsche
Georg Fritzsche

Reputation: 98984

If Boost is fine, take a look at create_directory() from Boost.Filesystem.

Upvotes: 7

Related Questions