Answer the question
In order to leave comments, you need to log in
Is it possible to create a tar archive that would store the creation/modification dates of a file?
Hello.
Interested in how to create an archive on a hosting that would save all the dates of creation/modification of files? And then I try to create tar.gz and as a result in the archive I see the date and time when these files were added to the archive, and when unpacking, the time when the files were created/modified becomes the current time (that is, the time when this archive was unpacked.)
Answer the question
In order to leave comments, you need to log in
They are already stored there, see for example www.fileformat.info/format/tar/corion.htm
mtime is the last modification time of the file at the time of its archiving.
If you look at the hexdump of an unpacked archive, you can see this field:
00000000 2e 67 69 74 69 67 6e 6f 72 65 00 00 00 00 00 00 |.gitignore......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 00 00 00 00 30 30 30 30 36 36 34 00 30 30 30 30 |....0000664.0000|
00000070 37 36 34 00 30 30 30 30 37 36 34 00 30 30 30 30 |764.0000764.0000|
00000080 30 30 30 30 30 30 30 00 31 32 30 34 33 37 30 32 |0000000.12043702|
00000090 36 37 36 00 30 31 33 32 30 31 00 20 30 00 00 00 |676.013201. 0...|
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question