diff --git a/EgtGeneral.rc b/EgtGeneral.rc index 0aed810..ec995a4 100644 Binary files a/EgtGeneral.rc and b/EgtGeneral.rc differ diff --git a/FileUtils.cpp b/FileUtils.cpp index ac30375..e721791 100644 --- a/FileUtils.cpp +++ b/FileUtils.cpp @@ -15,7 +15,7 @@ #include "stdafx.h" #include "\EgtDev\Include\EGnFileUtils.h" #include "\EgtDev\Include\EGnStringUtils.h" -#include "\EgtDev\Include\EGtStringConverter.h" +#include "\EgtDev\Include\EgtStringConverter.h" #include using namespace std ; @@ -44,7 +44,25 @@ ExistsFile( const string& sFile) bool CopyFileEgt( const string& sFile, const string& sNewFile) { - return ( ::CopyFileW( stringtoW( sFile), stringtoW( sNewFile), false) != 0) ; + // copio file + if ( ::CopyFileW( stringtoW( sFile), stringtoW( sNewFile), false) == 0) + return false ; + // recupero data ultima scrittura file sorgente + HANDLE hFile = CreateFileW( stringtoW( sFile), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL) ; + if ( hFile == INVALID_HANDLE_VALUE) + return true ; + FILETIME ftWrite ; + bool bOk = ( GetFileTime( hFile, NULL, NULL, &ftWrite) != FALSE) ; + CloseHandle( hFile) ; + if ( ! bOk) + return true ; + // scrivo data ultima scrittura file destinazione + HANDLE hNewFile = CreateFileW( stringtoW( sNewFile), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL) ; + if ( hNewFile == INVALID_HANDLE_VALUE) + return true ; + bool bNewOk = ( SetFileTime( hNewFile, NULL, NULL, &ftWrite) != FALSE) ; + CloseHandle( hNewFile) ; + return true ; } //-----------------------------------------------------------------------------