File Timestamps
The TargetRFS and TargetXFS file systems support the three POSIX file timestamps: time of last data access, time of last data modification, and time of last status change. These file systems also support links. Links have their own name and position in the directory hierarchy, but in addition to sharing the actual file data, the timestamps are shared by all links.
The API documentation on this site describes each routine’s effect on the timestamps, if relevant. A timestamp is updated by setting it to the current number of seconds since the Epoch. There are some anomalies, but a general summary of when the timestamps are updated is below:
- file (or directory) is created: The new file has all its timestamps updated. The parent directory’s status change and data modification timestamps are updated.
- A new link is created: The file’s status change timestamp is updated. The parent directory’s status change and data modification timestamps are updated.
- A file is read: It’s data access timestamp is updated (unless disabled by FSF_NOATIME or only a byte pushed back by ungetc() is read).
- A file is written: It’s status change and data modification timestamps are updated.
- A file is changed (chmod(), chown(), etc.): It’s status change timestamp is updated.
- A link is deleted: If the file still exists (i.e. there are other links), its status change timestamp is updated. The parent directory’s status change and data modification timestamps are updated.
The FAT file system only supports the following times: the time and date a file is created, the time and date of its last modification, and the date of its last access. TargetFAT saves files’ creation time and date, and the data modification and access timestamps are mapped onto FAT’s modification time/date and access date, but FAT has nothing that corresponds to the status change timestamp. References in the API pages to the status change timestamp do not apply to TargetFAT volumes.