Did you try to use mkdir()
function ? Another way to use:
boost filesystem: supports standard MAX_PATH size 260.
const char dir_path[] = "c:\\temp\\cplusplus";
boost::filesystem::path dir(dir_path); if(boost::filesystem::create_directory(dir)) { std::cout << "Success" << "\n"; }
SHCreateDirectoryEx function for Win XP(SP2) and Higher. However, it is limited to 247 characters, which is less than the standard MAX_PATH (260) that other Win32 API filesystem functions support
- CreateDirectory function : default string size limit for paths of 248 characters. This limit is related to how the CreateDirectory function parses paths. To extend this limit to
32,767
wide characters, call the Unicode version of the function and prepend"\\?\"
prefix to the path.
NOTE: Because most Boost.Filesystem operational functions just pass the contents of a class path object to the Windows API, they do work with the extended-length prefixes. But some won't work, because to the limitations imposed by Windows. -- Boost warning.