Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Problem with DirectoryExists() in windows
Problem with DirectoryExists() in windows [message #21852] Mon, 08 June 2009 13:19 Go to previous message
koldo is currently offline  koldo
Messages: 3372
Registered: August 2008
Senior Veteran
Hello all

When using DirectoryExists() with a drive name like

DirectoryExists("c:\\")


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
 
Read Message
Read Message
Previous Topic: [SOLVED] SHA1/MD5 encrypt example
Next Topic: EOL problem
Goto Forum:
  


Current Time: Tue Jun 11 04:14:52 CEST 2024

Total time taken to generate the page: 0.02325 seconds