fix file.Open("."); file.GetFileSize() asserts

This commit is contained in:
Glenn Maynard
2008-01-11 02:09:11 +00:00
parent a426b97bea
commit df75eb2cf7
+10
View File
@@ -106,6 +106,16 @@ RageFileObjDirect *MakeFileObjDirect( RString sPath, int iMode, int &iError )
return NULL;
}
#if defined(UNIX)
struct stat st;
if( fstat(iFD, &st) != -1 && (st.st_mode & S_IFDIR) )
{
iError = EISDIR;
close( iFD );
return NULL;
}
#endif
return new RageFileObjDirect( sPath, iFD, iMode );
}