Currently viewing: GipsySoft » Front Page» Articles

GetFileTimes

Get the three times associated with a file.

Tested in UNICODE.

bool GetFileTimes( LPCTSTR pcszFilename, FILETIME *lpCreationTime, FILETIME *lpLastAccessTime, 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 SetFileTimes