[Libreoffice] Tar / Zip wobbly

Kevin Hunter hunteke at earlham.edu
Wed Oct 27 10:10:57 PDT 2010


At 5:01pm -0400 Tue, 26 Oct 2010, Wols Lists wrote:
> Bear in mind tar is a perfectly good extraction utility

Heh.  If we're splitting hairs, I can't disagree with you.  The tar 
program, so-named from its original intended use with "tape archiving", 
is a utility to convert block data input (e.g. files and folders), and 
can extract select files from a tarball (e.g. somefile.tar).

However, you implied that it can natively handle Zip or other 
compression schemes.  Even in its "Gnu form" it can't.  In excellent 
Unix fashion, it actually outsources to other utilities.  In "olden" 
days, this was more explicit, where to untar a compressed archive you 
had to manually uncompress it:

$ gunzip < my_archive.tgz | tar -xf -

Nowadays, tar is usually able to at least recognize the file type of the 
input files it's given and do the above step automatically:

$ tar -xf my_archive.tgz

However, it still isn't smart enough to handle use cases where it can't 
see the underlying file:

$ cat my_archive.tgz | tar -xf -

To do this, you have to explicitly tell tar that the input stream is 
gzipped:

$ cat my_archive.tgz | tar -xzf -

You must do similar if it's compressed (-Z), bzipped (-j), or xzipped 
(-J), because it can't tell just by looking at the stream.

> I still stand by my comment "what is zip doing on a nix system?"

I'm curious by this comment.  Outside of the fact that Star/Open Office 
have used Zip since at least 2004 (personal experience says 2004, but 
probably since well before then), Zip is a very relevant compression and 
archiving utility.  The file format was created circa 1990 (Phil Katz, 
maybe?), and, because of lawsuits against his company, intentionally 
released into the public domain.  I've forgotten the exact story 
details, but the point is that Zip very much has cause -- and merit as 
an open software -- to be on a nix system.

To put a different spin on your surprise, I've wondered for awhile why 
it *isn't* installed in the default installation of more desktop-based 
nix distros.

Cheers,

Kevin


More information about the LibreOffice mailing list