I\'m trying to create a function that takes the name of a directory (C:\\foo\\bar, or ..\\foo\\bar\\..\\baz, or \\\\someserver\\foo\\bar
UnicodeString path = "C:\\Test\\Test\\Test\\";
TStringList *list = new TStringList();
try
{
list->Delimiter = '\\';
list->StrictDelimiter = true;
list->DelimitedText = path;
path = list->Strings[0]; \\drive letter
for(int i = 1; i < list->Count - 1; i++)
{
try
{
path += "\\" + list->Strings[i];
CreateDirectory(path.w_str(), NULL);
}
catch(...) { }
}
}
catch(...) { }
delete list;