EgtGeneral 2.2f1 :
- aggiunta funzione CompareFilesLastWriteTime.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user