The question

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 crtime, 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 stat and 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

  • Sorry for this stupid question but why should I feel the need to change the creation time of some file ?
    – MC68020
    Apr 9, 2022 at 13:56
  • 2
    @MC68020 Well, I have an Android app which apparently uses this creation time field to sort files (even though it says that it uses "modification time"). I copied some files from phone memory to SD card: that set creation and modification time of all files to current time. I put my SD card on my Linux computer to correct the mtime of files, but noticed that this specific app did not change its sorting, and used creation time instead. Also, I don't want to boot Windows to do something simple and useless like that ;)
    – Totor
    Apr 9, 2022 at 20:51


You must log in to answer this question.

Browse other questions tagged .