portability fixes
This commit is contained in:
@@ -633,19 +633,10 @@ unsigned int GetHashForDirectory( CString sDir )
|
|||||||
|
|
||||||
unsigned GetFileSizeInBytes( const CString &sFilePath )
|
unsigned GetFileSizeInBytes( const CString &sFilePath )
|
||||||
{
|
{
|
||||||
HANDLE hFile = CreateFile(
|
struct stat st;
|
||||||
sFilePath, // pointer to name of the file
|
stat(sFilePath.GetString(), &st);
|
||||||
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
|
|
||||||
);
|
|
||||||
|
|
||||||
DWORD dwSize = GetFileSize( hFile, NULL );
|
return st.st_size;
|
||||||
CloseHandle( hFile );
|
|
||||||
return dwSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DoesFileExist( const CString &sPath )
|
bool DoesFileExist( const CString &sPath )
|
||||||
|
|||||||
Reference in New Issue
Block a user