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.

从这里:http://msdn.microsoft.com/en-us/library/aa365739(v=vs.85).aspx

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

相关文章

Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...
Windows文件操作基础代码 Windows下对文件进行操作使用的一段...
Winpcap基础代码 使用Winpcap进行网络数据的截获和发送都需要...
使用vbs脚本进行批量编码转换 最近需要使用SourceInsight查看...