As of today, Unix standards don't support a file "creation time" attribute. However, many filesystems, like ext4, exFAT and NTFS, internally do save a creation time for their files.
Note: I'm talking about creation time (aka
btime or birth time), not
ctime (aka change time).
For a while, even when using ext4 on Linux, this information was not easily accessible (need to use
debugfs), but now, the new Linux
statx() interface offers an easy way (API) to access file creation time, so that tools like
ls started to integrate features based on files creation time (read only though).
MAIN QUESTION: How can I change the creation time of a file on an exFAT filesystem? (using Linux)
Thinking out loud
My guess is that it is not implemented yet on the full toolchain, so: what is missing?
- I know that since kernel 5.7, the Linux kernel has a new internal implementation of exFAT contributed from Samsung. Does this new implementation (or any other) supports changing file timestamps (modify, creation...)?
- Is it implemented on the linux VFS side to change a file creation time?
- Is there any Linux API (kernel & userspace) to change file creation time?
- If not, would it be possible, given the current Linux kernel or FUSE implementations of exFAT, to (fairly easily) write a tool that would change a file creation time?
A few resources
- This Windows-only tool allows such changes: http://www.nirsoft.net/utils/bulk_file_changer.html
- This pretty much detailed blog article asks the same question and, as of now, says that it is not possible: https://miloserdov.org/?p=3069