src/sgp/FileMan.cc
/** Open file in the given folder in case-insensitive manner.
 * @return file descriptor or -1 if file is not found. */
Open file in the given folder in case-insensitive manner.
@return file descriptor or -1 if file is not found.
Open file in the given folder in case - insensitive manner . @return file descriptor or - 1 if file is not found .
int FileMan::openFileCaseInsensitive(const std::string &folderPath, const char *filename, int mode)
{
	std::string path = FileMan::joinPaths(folderPath, filename);
	int d = open(path.c_str(), mode);
	if (d < 0)
	{
#if CASE_SENSITIVE_FS
		std::string newFileName;
		if(findObjectCaseInsensitive(folderPath.c_str(), filename, true, false, newFileName))
		{
			path = FileMan::joinPaths(folderPath, newFileName);
			d = open(path.c_str(), mode);
		}
#endif
	}
	return d;
}
int FileMan :: openFileCaseInsensitive ( const std :: string & folderPath , const char * filename , int mode ) { std :: string path = FileMan :: joinPaths ( folderPath , filename ) ; int d = open ( path . c_str ( ) , mode ) ; if ( d < 0 ) { #if CASE_SENSITIVE_FS std :: string newFileName ; if ( findObjectCaseInsensitive ( folderPath . c_str ( ) , filename , true , false , newFileName ) ) { path = FileMan :: joinPaths ( folderPath , newFileName ) ; d = open ( path . c_str ( ) , mode ) ; } #endif } return d ; }
Open file in the given folder in case-insensitive manner.
Open file in the given folder in case - insensitive manner .
// on case-sensitive file system need to try to find another name