View Single Post

   
  #5 (permalink)  
Old 01-16-2008, 05:46 PM
Joerg Schilling
 
Posts: n/a
Default Re: tar and gzip

In article <AImnELE66$D$Ewtf@ponle.demon.co.uk>,
Walter Briscoe <wbriscoe@ponle.demon.co.uk> wrote:
>In message <pan.2003.07.12.03.08.44.944236@and.org> of Fri, 11 Jul 2003
>23:08:49 in comp.unix.misc, James Antill <james-netnews@and.org> writes


>>>>give the resulting file the .tgz extension.
>>>>
>>>>> I get an error when I try to tar -cvzf a file, saying the z in not a valid
>>>>> variable. Does this mean I need to install GNUgzip?
>>>>
>>>>It means you need to install gnu tar, or use
>>>>the method
>>>
>>> GNU tar does not create standard compliant TAR archives, use star instead:

>Chapter & verse? I presume "standard compliant" means compliant with
>http://www.opengroup.org/onlinepubs/...ities/pax.html


See later for the standard you mention here.....

First, there is http://www.opengroup.org/onlinepubs/...9/xcu/pax.html
which is commonly called UNIX-98. The TAR archive standard format
described in this standard is identical to POSIX.1-1990, star is the only known
TAR implementation that correectly implements this standard. GNU tar does not
even follow this standard although it's precursor (PD-tar) where GNU tar has
been derived from did implement a clean subset of the POSIX standard in 1987.
The fact that GNU tar is not POSIX compliant has been "implemented" by FSF -
most likely by Jay Fenlason (hack@ai.mit.edu).

Unfortunately, not even the officiel PAX reference implementation implements
http://www.opengroup.org/onlinepubs/...9/xcu/pax.html correctly. To learn
where exactly the deviations are, get a recent star source, e.g.

ftp://ftp.berlios.de/pub/star/alpha/star-1.5a16.tar.gz

and use the program called 'tartest' together with the related documentation.
This of course may also used to understand why GNU tar is not POSIX archive
compliant.

Now to your URL
http://www.opengroup.org/onlinepubs/...ities/pax.html

it describes a new TAR format called 'PAX' which is POSIX.1-1990 TAR + extended
TAR headers. Star is currently the only program that implements the 'PAX'
archive format from
http://www.opengroup.org/onlinepubs/...ities/pax.html


>> Of course, 1) No one cares it's not "std. compliant" as it's real life
>>compliant. 2) star has't fixed a bunch of the ways you can attack tar that
>>have been fixed in GNU tar for a long time. 3) star's command line is
>>annoyingly different.
>>

>Details?


Star implements a command line parser that is compliant to:

http://www.opengroup.org/onlinepubs/...9/xcu/tar.html

GNU tar does not.

Star in addition tries to follow
http://www.opengroup.org/onlinepubs/.../utilconv.html and
http://www.opengroup.org/onlinepubs/...bd_chap12.html
as best as possible with respect to:

http://www.opengroup.org/onlinepubs/...9/xcu/tar.html


GNU tar implemenets _and_ documents a command line syntax driven by what
getopt() supports. Note that this is _not_ what POSIX defines.
POSIX defines that the official interface is what the documentation for
the program defines - even if getopt() would allow other things in addition.
POSIX defines getopt() but does _not_ require to use it! Star uses getargs()
which is older and more powerful than getopt() and which follows the POSIX
guidelines.

A big problem with GNU tar is that its documents describe a syntax like

gtar -cbf 126 /dev/rmt/0 ....

which is definitely not compliant with any POSIX document. A program like star
that better follows POSIX requires

star -c -b 126 -f /dev/rmt/0 ...

instead.

Sometimes I get the impression that there are people besides Microsoft who
believe that it os better not to follow standards but by creating 'own
standards'.

--
EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
js@cs.tu-berlin.de (uni) If you don't have iso-8859-1
schilling@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily
Reply With Quote