|
char strPath[_MAX_PATH];
char strTemp[_MAX_PATH];
char *pPoint = strPath;
HANDLE hFindFile;
WIN32_FIND_DATA FindFileData;
strcpy(strPath, "D:\\AAA\\BBB\\CCC");
if (strPath[strlen(strPath) - 1] != '\\')
{
strcat(strPath, "\\");
}
while (pPoint = strchr(pPoint + 1, '\\'), pPoint != NULL)
{
strcpy(strTemp, strPath);
strTemp[pPoint - strPath] = '\0';
hFindFile = FindFirstFile(strTemp, &FindFileData);
if (hFindFile == INVALID_HANDLE_VALUE)
{
CreateDirectory(strTemp, NULL);
}
else
{
FindClose(hFindFile);
}
}
|