I'm sharing here a tiny program for playing with ntfs timestamps in case it may be useful to others.
NTFS supports four file timestamps:Creation
This is the moment when the file was created
on the filesystem.Modification
Last time the content
of the file changed
Last time the file was read
. Pretty much useless since so many apps will read them without user intervention.Change
Last time the file metadata
changed (eg. setting the modification time).
Traditionally (FAT) Windows supported the first three, while Unix systems have long used just the last three.
NTFS-3g properly understand all of them, and additionally expose them in the system.ntfs_times extended attribute.http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/#filetimes
However, the extended attribute format is not suitable for human consumption, and Unix utilities like stat(1) know
nothing about creation time, so they will only show Unix times.
This program, when run with a filename as a parameter, shows the four times for the file (provided that the target
file is on a ntfs-3g mounted volume and the extended attributes aren't disabled).
You can also provide a second filename parameter, and then the ntfs times from the first file are copied to the
second with the creation time stored in Unix change time field.
This is specially convenient for preserving times on target files stored on a FAT partition, where the same field is
interpreted by Windows as creation time and by Linux as change time.
Note that this second method of operation should be run with an idle system with no other users, and that you need to be
able to change the system clock (CAP_SYS_TIME). Since the change time is set by moving the system clock backwards a fraction
of time, other users/processes that could be running could be negatively affected by such change, including mismatched log
Feel free to use/modify it under GPL, although if it results useful for you, it'd be nice if you left a message here.