加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

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

发布时间:2020-12-13 23:43:54 所属栏目:Windows 来源:网络整理
导读:我正在使用GetFileTime检查文件的上次访问时间,它可以工作.但它甚至给我时间我最后一次点击它的时间,这是预期的吗?但它不会显示在文件属性的“常规”选项卡中的“已访问:”字段中. 简答:是的,右键单击文件更新的文件信息并触发记录的更新,并可由GetFileTi
我正在使用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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读