3

POSIX tar archives contain POSIX headers as "dummy" files named @PaxHeader. 7zip dutifully extracts them, and they all collide, since they are all named the same. 7z then complains about the file being in use, and finishes with errors. It does extract other files, and the extended headers are of no use on Windows anyway.

This problem arose in the context of extracting Qt .tar.xz archives when building Qt on Windows. The .tar.xz files are more compact than the .zip files, and it helps to reduce load in CI environments, where Qt may be downloaded and rebuilt often.

Is there a way to work around that?

2

tar.exe installed with "Git for Windows" can handle POSIX tarballs.

A lot of tar.exe and other compression programs like 7-zip that can handle tarballs too will sometimes (not allways) fail with archives containing Paxheaders. In most of the programs there are parameters that make it very likely to oversee the errors when extracting POSIX tarballs. Possible errors are shortened filenames and filenames without extensions (maybe some more).

tar.exe from "Git for Windows" can be used "stand-alone", i.e. outside git-bash in a windows command file or at the prompt. Best solution is to use full path to your installation:

C:\Program Files\Git\usr\bin\tar.exe -xf archive.tar.gz

The path to your git installation might be different depending on your installation. Be sure to use the right tar.exe.

which tar.exe

or

where tar.exe

might be helpfull to figure out.

1

When listed with 7z l, these .tar archives contain a multitude of identically named files called .\.\@PaxHeader. Adding this file name to an exclude list given to 7z solves the problem.

The excludes can be provided either on the command line, i.e. "-x.\.\@PaxHeader", or in an exclude list file, e.g. -x@my.excludes, where the my.excludes file contains at least the .\.\@PaxHeader line.

2
  • 1
    This is no propper solution. In certain constellations you will loose information (like fileextention or part of the filename) that is stored within the Paxheader. With some tarballs ././@PaxHeader should be someting like ./paxheaders.* Feb 24 at 19:37
  • @Christian4145 It's certainly not a universal solution, but it works - or at least worked not long ago - in the context of Qt, and that was my immediate concern. It's usually easy to detect failures: since those are source archives, the build fails if something important gets messed up in extraction - although a passing build is not always a guarantee. Aug 23 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.