From 260bf22a2935efd71fafa2d2c1f3467adc31b68d Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 17 Dec 2002 06:50:30 +0000 Subject: [PATCH] portability fixes --- stepmania/src/RageUtil.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index eba8914331..7ee93d713d 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -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 )