“修改日期”的规则 Windows 资源管理器中的文件夹数量

发布于 2024-07-25 01:20:50 字数 608 浏览 3 评论 0原文

Windows 资源管理器如何确定文件夹的“修改日期”字段? [旁白:我知道这是从特定于浏览器的角度提出的问题,但该行为可能对编码搜索/排序类型活动有用]

是否有对此的明确描述 - Microsoft、MSDN 搜索、谷歌和 堆栈溢出没有成功。

个人实验似乎表明,在文件夹树中:

  1. 当在文件夹中添加/删除文件夹/文件时,包含文件夹的修改日期会更新。
  2. 当文件的内容被修改时,包含的文件夹不受影响

但是,我正在查看一些似乎不符合这些基本规则的目录 - 沿着我拥有的树运行(日期为 DD/MM/YYYY 格式):

folder     (date created:  2/2/2006, date modified: 2/3/2006)
  folder   (date created:  2/2/2006, date modified: 2/3/2006)
    folder (date created:  2/2/2006, date modified: 1/6/2009)
      file (date created: 27/3/2009, date modified: 2/2/2006)

How does Windows Explorer determine the "Date Modified" field for folders? [Aside: I know this is asking from an explorer-specific perspective, but the behaviour could be useful to coding search/sort type activities]

Is there a definitive description of this anywhere - searches of Microsoft, MSDN, Google & Stack Overflow have been unsuccessful.

Personal experiments seem to suggest that in a tree of folders:

  1. when a folder/file is added/deleted in a folder, the containing folder's date modified is updated.
  2. when the content of a file is modified, the containing folder is unaffected

However, I'm looking at some directories that don't seem to conform to these basic rules - running down the tree I have (dates in DD/MM/YYYY format):

folder     (date created:  2/2/2006, date modified: 2/3/2006)
  folder   (date created:  2/2/2006, date modified: 2/3/2006)
    folder (date created:  2/2/2006, date modified: 1/6/2009)
      file (date created: 27/3/2009, date modified: 2/2/2006)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

大姐,你呐 2024-08-01 01:20:51

这不是特定于浏览器的,而是与 NTFS 相关的。

请参阅http://support.microsoft.com/kb/299648 https://web.archive.org/web /20080219020154/http://support.microsoft.com/kb/299648 了解一些规则。

注意:可以使用文件系统选项禁用修改时间,因此您永远不应该依赖它。 任何建议的可靠方法将不胜感激。

This is not explorer specific, this is NTFS-related.

See http://support.microsoft.com/kb/299648 https://web.archive.org/web/20080219020154/http://support.microsoft.com/kb/299648 for some rules.

Note: Modified time can be disabled with filesystem option, so you should never rely on it. Any suggested reliable methods would be appreciated.

一腔孤↑勇 2024-08-01 01:20:50

免责声明:我自己在 Windows 10 上测试了所有这些行为。我找不到记录所有这些行为的权威来源。 我完全有可能在某个地方犯了错误。

针对以下操作更新文件夹的上次修改时间:

  • 直接在目标文件夹中新建文件或文件夹
  • 直接在目标文件夹中重命名文件或文件夹 直接在目标文件夹中
  • 删除文件或文件夹
  • 硬链接创建/删除/重命名 - 相同作为文件
  • 文件/文件夹 符号链接 创建/删除/重命名
  • 目录连接 创建/删除/重命名

以下操作未更新

  • 直接在目标文件夹中修改文件内容
  • 编辑目标中包含的符号链接或连接的目标文件夹
  • 文件或子文件夹的创建/修改日期 更改
  • 编辑直接子文件夹的基本属性(隐藏/存档/系统)
  • NTFS 压缩/加密 更改直接子
  • 文件夹中发生的任何事情 - 实际上是任何
  • 更改文件夹属性的事情文件夹本身
  • 更改文件夹本身的所有者/ACL
  • 所有者或直接子文件的 ACL 更改(
  • 如果文件夹是目录连接)、更改目标
  • 添加/删除替代数据流到直接子文件

Disclaimer: I tested all of these myself on Windows 10. I could not find an authoritative source documenting all of these behaviours. It is entirely possible that I made a mistake somewhere.

The folder's last modified time is updated for these actions:

  • new file or folder directly in target folder
  • renamed file or folder directly in target folder
  • deleted file or folder directly in target folder
  • hardlink create/delete/rename - same as files
  • file/folder symlink create/delete/rename
  • directory junction create/delete/rename

It is not updated for these actions:

  • modified contents of file directly in target folder
  • edit target of symlink or junction contained in target folder
  • file's or sub-folder's created/modified date changing
  • edit basic attributes (hidden/archive/system) of a direct child
  • NTFS compression/encryption change of a direct child
  • anything at all happening in a sub-folder - literally anything
  • changing attributes of the folder itself
  • changing owner/ACL of the folder itself
  • owner or ACL of a direct child changing
  • if the folder is a directory junction, changing the target
  • adding/deleting alt data streams to a direct child file
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文