Currently viewing: GipsySoft » Front Page» Articles

SetFileTimes

Set the three times associated with a file.

Tested in UNICODE.

bool SetFileTimes( LPCTSTR pcszFilename, const FILETIME *lpCreationTime, const FILETIME *lpLastAccessTime, const FILETIME *lpLastWriteTime );

Return value

Return true if the function succeeds

Example

FILETIME CreationTime, LastAccessTime, LastWriteTime;
VERIFY( GetFileTimes( _T("c:\\autoexec.bat")
          , &CreationTime
          , &LastAccessTime
          , &LastWriteTime ) );

VERIFY( SetFileTimes( _T("c:\\autoexec.bat")
          , &CreationTime
          , &LastAccessTime
          , &LastWriteTime ) );

 

Click to view the source code

See also GetFileTimes