portability fixes

This commit is contained in:
Glenn Maynard
2002-12-17 06:50:30 +00:00
parent d937b91993
commit 260bf22a29
+3 -12
View File
@@ -633,19 +633,10 @@ unsigned int GetHashForDirectory( CString sDir )
unsigned GetFileSizeInBytes( const CString &sFilePath )
{
HANDLE hFile = CreateFile(
sFilePath, // pointer to name of the file
GENERIC_READ, // access (read-write) mode
FILE_SHARE_READ|FILE_SHARE_WRITE, // share mode
NULL, // pointer to security attributes
OPEN_EXISTING, // how to create
FILE_ATTRIBUTE_NORMAL, // file attributes
NULL // handle to file with attributes to
);
struct stat st;
stat(sFilePath.GetString(), &st);
DWORD dwSize = GetFileSize( hFile, NULL );
CloseHandle( hFile );
return dwSize;
return st.st_size;
}
bool DoesFileExist( const CString &sPath )