windows 上次修改的文件夹

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/153803/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 11:20:55  来源:igfitidea点击:

Last Modified of Folders

windowsfilesystems

提问by Mike

How does Windows determine the last modified date of a folder?

Windows 如何确定文件夹的上次修改日期?

采纳答案by Martijn

According to MSDN, the last modification timestamp is stored per directory:

根据MSDN,上次修改时间戳存储在每个目录中:

  • If you create two new folders on an NTFS partition called D:\NTFS1 and D:\NTFS2, both the created and modified date and time are the same.
  • If you move the D:\NTFS2 folder into the D:\NTFS1 folder, creating D:\NTFS1\NTFS2, then:
    1. D:\NTFS1 - The created folder is the same and the modified stamp changes.
    2. D:\NTFS1\NTFS2 - Both the created folder changes and the modified folder stay the same. This behavior occurs because, even though you moved the folder, a new folder is seen as being created within the D:\NTFS1 folder by the Master File Table (MFT).
  • If you copy the D:\NTFS2 folder into the D:\NTFS1 folder, creating the D:\NTFS1\NTFS2 folder, and the D:\NTFS2 folder still exists (after having copied it):
    1. D:\NTFS1 - The created folder is the same and the modified folder time and date stamp changes.
    2. D:\NTFS2 - No changes occur because it is the original folder.
    3. D:\NTFS1\NTFS2 - Both the created folder and the modified folder changes to the same stamp, which is that of the time of the move.
      This behavior occurs because even though you copied the folder, the new folder is seen as being created by the MFT and is given a new created and modified time stamp.

Note: The design and behavior of the FAT file system is different with regards to the modified time stamp. On a FAT file system, the modified date of a folder does not change if the contents of the folder change. For example, if you have D:\FAT1 and D:\FAT2, and you copy or move D:\FAT2 into D:\FAT1, the created date and modified date of D:\FAT1 remains the same.

  • 如果在名为 D:\NTFS1 和 D:\NTFS2 的 NTFS 分区上创建两个新文件夹,则创建和修改的日期和时间都相同。
  • 如果将 D:\NTFS2 文件夹移动到 D:\NTFS1 文件夹中,创建 D:\NTFS1\NTFS2,则:
    1. D:\NTFS1 - 创建的文件夹相同,修改的图章发生变化。
    2. D:\NTFS1\NTFS2 - 创建的文件夹更改和修改的文件夹保持不变。出现此行为的原因是,即使您移动了文件夹,主文件表 (MFT) 仍会在 D:\NTFS1 文件夹中看到一个新文件夹。
  • 如果将 D:\NTFS2 文件夹复制到 D:\NTFS1 文件夹中,创建 D:\NTFS1\NTFS2 文件夹,并且 D:\NTFS2 文件夹仍然存在(复制后):
    1. D:\NTFS1 - 创建的文件夹相同,修改后的文件夹时间和日期戳发生变化。
    2. D:\NTFS2 - 因为它是原始文件夹,所以不会发生任何变化。
    3. D:\NTFS1\NTFS2 - 创建的文件夹和修改的文件夹都更改为相同的标记,即移动时间的标记。
      出现此问题的原因是即使您复制了该文件夹,新文件夹仍被视为由 MFT 创建并被赋予一个新创建和修改的时间戳。

注意:FAT 文件系统的设计和行为在修改时间戳方面有所不同。在 FAT 文件系统上,如果文件夹的内容发生更改,则文件夹的修改日期不会更改。例如,如果您有 D:\FAT1 和 D:\FAT2,并且您将 D:\FAT2 复制或移动到 D:\FAT1,则 D:\FAT1 的创建日期和修改日期保持不变。

回答by Gulzar Nazim

uses the date of last file activity inside the folder.

使用文件夹内最后一个文件活动的日期。

回答by Brian Knoblauch

When a directory entry is updated, the last modified date of the directory itself is also updated.

当目录条目被更新时,目录本身的最后修改日期也被更新。