Cross-platform compatible directory creation in C++
I need to 开发者_Go百科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.
If Boost is fine, take a look at create_directory()
from Boost.Filesystem.
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
.
精彩评论