Home » U++ Library support » U++ Core » Problem with DirectoryExists() in windows
Problem with DirectoryExists() in windows [message #21852] |
Mon, 08 June 2009 13:19 |
|
koldo
Messages: 3358 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
When using DirectoryExists() with a drive name like
it returns false.
Revising the code I have seen that FindFirstFileW("C:\\") return INVALID_HANDLE_VALUE.
Perhaps a way to solve this would be check if directory name is a drive, so the changed DirectoryExists() could be:
bool DirectoryExists(const char *name) {
#if defined(PLATFORM_WIN32)
if (GetDriveType(name) != DRIVE_NO_ROOT_DIR)
return true;
#endif
FindFile ff(name);
return ff && ff.IsDirectory();
}
Best regards
Koldo
Best regards
IƱaki
|
|
|
|
Goto Forum:
Current Time: Mon Apr 29 14:04:20 CEST 2024
Total time taken to generate the page: 0.02698 seconds
|