3

I am checking file's last access time using GetFileTime, It works. But it even gives me the time the time I last right clicked on it, is this expected ? but it doesn't show up in Accessed: field in General Tab of file properties.

1

1 Answer 1

3

Short answer: Yes, right-clicking on a file updated information about the file and triggers an update that is recorded and can be retrieved by GetFileTime.

However, the real answer is kinda complex.

NTFS technically updates the LastAccess Time simply by listing the files in a directory. So just opening the directory a file is in triggers an update for ALL of the files in that directory.

Beginning in Windows 7 there is a registry entry that disables this in order to prevent the NTFS log from filling up. The default value prevents NTFS from updating the last-access timestamp on each file and directory when it lists the directories in an NTFS volume: https://technet.microsoft.com/en-us/library/cc959914.aspx

Different filesystems and different metrics in those systems have differing time resolutions as well:

Not all file systems can record creation and last access times, and not all file systems record them in the same manner. For example, the resolution of create time on FAT is 10 milliseconds, while write time has a resolution of 2 seconds and access time has a resolution of 1 day, so it is really the access date. The NTFS file system delays updates to the last access time for a file by up to 1 hour after the last access.

See here for more information on this: http://msdn.microsoft.com/en-us/library/ms724290(v=vs.85).aspx

For a file, the structure specifies when the file is last read from or written to. For a directory, the structure specifies when the directory is created. For both files and directories, the specified date is correct, but the time of day is always set to midnight. If the underlying file system does not support last access time, this member is zero.

From here: http://msdn.microsoft.com/en-us/library/aa365739(v=vs.85).aspx

These were found here: https://superuser.com/questions/232143/windows-7-file-properties-is-date-accessed-always-100-accurate

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .