I have a utility written in go that creates a tar.gz archive. It preserves file times inside the PAX headers while creating the archive. The file times I am explicitly adding to PAX headers are: atime (access time), btime (creation/birth time), mtime (modified time). These are needed for forensic analysis.

When the archive is created on a Windows, the files don't have atime, but they do when collected on a macOS.
I am getting the correct btime and mtime on both platforms.

Here is the code that I am using to add the PAX record dict:

header.Format = tar.FormatPAX header.PAXRecords = make(map[string]string) header.PAXRecords["atime"] = file.AccessTime header.PAXRecords["LIBARCHIVE.creationtime"] = file.BirthTime header.PAXRecords["mtime"] = file.ModTime

Why is the atime missing from any Windows archive? Can I use some other key for the dictionary so that atime is not ignored by the Windows filesystem?

K G's user avatar

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.