use gtar and not tar under solaris

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Mon Aug 10 07:27:22 EDT 2009


On Fri, 2009-08-07 at 13:14 +0200, Christian Maeder wrote:
> Christian Maeder wrote:
> > Matthias Kilian wrote:
> >> However, to create an archive, you can use something like
> >>
> >> $ pax -wf foo.tar directory
> > 
> > Do you think "gtar --format=posix" would be different from pax?

I would expect they are the same. The USTAR format is standardised by a
POSIX standard from 1988 while the pax extensions are standardised by
POSIX from 2001 I think. The pax program has an -x format flag and can
use pax, ustar or cpio formats. The pax format is an extension of the
ustar format.

> > The only question is, if we should create archives using the ustar,
> > posix/pax, or gnu format. ustar seems to be the least common
> > denominator. Does ustar have any disadvantages?

For source code distribution I think the ustar format is ideal. This is
what cabal-install's sdist mode uses. As you say it's the lowest common
denominator. The limitations of the format (file sizes, lack of extended
file meta-data) are not a practical problem for source code or binaries.

> My plain tar command under solaris cannot handle the pax files, too.
> So ustar archives should be created (at least under solaris).

That's odd since pax is supposed to be a compatible extension of ustar
that just adds extra meta-data entries. Older programs should either
ignore those entries or extract them as if they were ordinary files.

> But I don't know why the ustar format can handle long file names,

The ustar format can handle file names up to 100+155 characters (bytes)
long. The reason for 100+155 is that it's not simply 255. The split into
a 100 and 155 field must happen on a directory separator.

> whereas the gnu format creates a "@LongLink" file and pax a "PaxHeader"
> file (when unpacked with tar).

Right, those "files" are the extended entries.

Duncan



More information about the Glasgow-haskell-users mailing list