diff --git a/EgtGeneral.rc b/EgtGeneral.rc index fca73ed..67dff8e 100644 Binary files a/EgtGeneral.rc and b/EgtGeneral.rc differ diff --git a/FileUtils.cpp b/FileUtils.cpp index bee94c9..b09fdc8 100644 --- a/FileUtils.cpp +++ b/FileUtils.cpp @@ -61,6 +61,32 @@ EraseFile( const string& sFile) return ( ::DeleteFileW( stringtoW( sFile)) != 0) ; } +//----------------------------------------------------------------------------- +static bool +GetFileLastWriteTime( const string& sFile, FILETIME& ftWrite) +{ + HANDLE hFile = CreateFileW( stringtoW( sFile), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL) ; + if ( hFile == INVALID_HANDLE_VALUE) + return false ; + bool bOk = ( GetFileTime( hFile, NULL, NULL, &ftWrite) != FALSE) ; + CloseHandle( hFile) ; + return bOk ; +} + +//----------------------------------------------------------------------------- +bool +CompareFilesLastWriteTime( const string& sFile1, const string& sFile2, int& nRes) +{ + FILETIME ftWrite1 ; + if ( ! GetFileLastWriteTime( sFile1, ftWrite1)) + return false ; + FILETIME ftWrite2 ; + if ( ! GetFileLastWriteTime( sFile2, ftWrite2)) + return false ; + nRes = CompareFileTime( &ftWrite1, &ftWrite2) ; + return true ; +} + //----------------------------------------------------------------------------- string ChangeFileExtension( const string& sFile, const string& sNewExt)