0

i have an mp4 file and running exiftool i can see that the "File Inode Change Date/Time" tag changes when i touch it, but it changes to the current time and not to the date that i have specified with --date argument:

touch -am --date=@0 FILE 

How can i touch the "File Inode Change Date/Time" to the date specified by the --date argument ?

Chris Davies
  • 116,213
  • 16
  • 160
  • 287

1 Answers1

1

You cannot change the inode change time (ctime) to an arbitrary value. The system always updates the inode change time to the current time when the inode changes. That's what it's for: the ctime is supposed to be the time the inode changed.

touch FILE (or touch -m FILE) changes the file's modification time. The file's modification time is supposed to be the time when the file's content last changed. You can set it arbitrarily. For example, when backup tools restore a file, they reset the extracted file's modification time to the time recorded in the backup. In this example, the restored file's inode change time will be the time at which the file was restored from backup.

Note that the ctime is a property of the file itself, not something encoded inside the file. exiftool displays it for files that have EXIF data, but it's more common to display it with ls -lc. A copy of the file would have its own ctime.

If you're the system administrator and you absolutely want to change a ctime, you can set the system clock to a little before the desired time, wait until the exact time, run touch -r FILE FILE, and set the system clock back to the actual time. There's no real point to it, but you can do it if you want to.