I have to create a directory structure recursively in C
Currently I am using the following logic in c++:
void createDirectoryRecursively(std::wstring path)
{
unsigned int pos = 0;
do
{
pos = path.find_first_of(L"\\/", pos + 1);
CreateDirectory(path.substr(0, pos).c_str(), NULL);
} while (pos != std::string::npos);
}
How can I create a directory structure recursively in a single API functions call in windows by providing only the path I need?