Is there anyway to make a tar
archive that includes the creation times for the files/directories inside of it?
Asked
Active
Viewed 565 times
2

Melab
- 4,048
-
1creation time is not readily accessible on linux (ext4 for eg.) even though the filesystem has this info. – jai_s Jun 20 '19 at 04:57
-
@jai_s it is accessible now, see muru’s comment below. – Stephen Kitt Jun 20 '19 at 09:51
1 Answers
2
No, it is not possible (outside the scope of tar
) because the POSIX standard does not define a timestamp for file creation. Some filesystems (e.g. ext4, JFS, Btrfs) store this value, but currently there is no Linux kernel API to access it.
Timestamp values that are readily accessible on Linux are:
mtime
Time of last modification to file contents (data itself)ctime
Time of last change to file contents or file metadata (owner, group, or permissions)atime
Time of last access to file for reading contents

dr_
- 29,602
-
3There's an API now: https://unix.stackexchange.com/a/407305/70524 (but I don't think modifying creation time is possible anyway) – muru Jun 20 '19 at 06:32