windows-server-2008 – “右键单击文件”会更新其上次访问时间吗?

前端之家收集整理的这篇文章主要介绍了windows-server-2008 – “右键单击文件”会更新其上次访问时间吗?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用GetFileTime检查文件的上次访问时间,它可以工作.但它甚至给我时间我最后一次点击它的时间,这是预期的吗?但它不会显示文件属性的“常规”选项卡中的“已访问:”字段中.
简答:是的,右键单击文件更新的文件信息并触发记录的更新,并可由GetFileTime检索.

然而,真正的答案有点复杂.

NTFS技术上只需在目录中列出文件即可更新LastAccess Time.因此,只需打开文件所在的目录,就会触发该目录中所有文件的更新.

Windows 7开始,有一个注册表项禁用此项以防止NTFS日志填满.默认值阻止NTFS在列出NTFS卷中的目录时更新每个文件和目录的最后访问时间戳:https://technet.microsoft.com/en-us/library/cc959914.aspx

这些系统中的不同文件系统和不同指标也具有不同的时间分辨率:

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.

有关详细信息,请参见此处: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.

从这里:@L_404_3@

这些在这里找到:https://superuser.com/questions/232143/windows-7-file-properties-is-date-accessed-always-100-accurate

猜你在找的Windows相关文章