sqlparser/file.cpp
// Check if the path points to an existing directory
Check if the path points to an existing directory
Check if the path points to an existing directory
bool File::IsDirectory(const char *path)
{
	if(path == NULL)
		return false;
#ifdef WIN32
	struct _finddata_t fileInfo;
	int findHandle = _findfirst(path, &fileInfo); 
	if(findHandle == -1)
	{
		_findclose(findHandle);
		return false;
	}
	bool dir = IsDirectory(&fileInfo);
	_findclose(findHandle);
	return dir;
#else
	struct stat fileInfo;
	if(stat(path, &fileInfo) != -1)
	{
		if(S_ISDIR(fileInfo.st_mode))
			return true;
	}
	return false;
#endif
}
bool File :: IsDirectory ( const char * path ) { if ( path == NULL ) return false ; #ifdef WIN32 struct _finddata_t fileInfo ; int findHandle = _findfirst ( path , & fileInfo ) ; if ( findHandle == -1 ) { _findclose ( findHandle ) ; return false ; } bool dir = IsDirectory ( & fileInfo ) ; _findclose ( findHandle ) ; return dir ; #else struct stat fileInfo ; if ( stat ( path , & fileInfo ) != -1 ) { if ( S_ISDIR ( fileInfo . st_mode ) ) return true ; } return false ; #endif }
Check if the path points to an existing directory
Check if the path points to an existing directory
// Check if a file or directory exists with this name // Check for a directory // Check that this is a directory