Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Last Modified of Folders

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

like image 265
Mike Avatar asked Sep 30 '08 16:09

Mike


2 Answers

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

  • 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.

like image 100
Martijn Avatar answered Sep 28 '22 09:09

Martijn


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

like image 44
Brian Knoblauch Avatar answered Sep 28 '22 09:09

Brian Knoblauch