From: alawrenc@sobeco.com (a.lawrence)
Subject: Zip, Unzip, Compress & Tar (was: ANSWER ...)
Reply-To: alawrenc@sobeco.com
Organization: Lawrence & Assc.
Date: Wed, 14 Oct 92 22:28:42 GMT

In <1992Oct14.074008.20541@klaava.Helsinki.FI> wirzeniu@klaava.Helsinki.FI (Lars Wirzenius) writes:

>davidsen@crd.ge.com (bill davidsen) brings up the question of using a
>better compression program than compress(1), suggesting info-zip zip and
>unzip as good replacements.

>This has come up once or twice already, and I think that the main points
>have been more or less like this:

>For:
>	- better compression
>	- built in crc checking

>Against:
>	- uncompress is everywhere in Unix-land, zip and unzip are not
>	- most compression programs have a bad understanding of Unix
>	  filesystem peculiarities (permissions, links, etc)

Zip and Unzip may not be part of the base system everywhere in Unix land,
but they are _freely_ available and the same source files can be used to
install them not only on just about any flavor of unix, but almost every
other type of computer and operating system in use today.

Personally I use Zip and Unzip a great deal, 1) because they have one
of the best compression ratio's available today, 2) because I can (have)
installed them on every machine (and OS) I have access to (Mips, DOS,
Linux, etc).

Using Zip for backups is easy...

	tar cf - . | zip backup -

and

	unzip -p backup | tar [tx]f -

>Personally, I wouldn't object to using .tar.zip instead of .tar.Z, even
>without the GNU tar hack.  I do object to .zip of a lot of individual
>files.  Actually, what I would like most of all, is zip and unzip with
>the user interface of compress and uncompress.

Using Zip, the only loss is the 'z' option of GNU tar, and since the
source code and algorithm for unzip are freely available, adding a
'Z' option to GNU tar should not be difficult.  The Zip packages already
support stdin and stdout, so they are functionally equivalent to
compress.  Another added benefit is that the Zcrypt module adds 
encryption to the Zip programs -- with sources kept outside the US of A
so that we don't have to worry about US export restrictions on 
"munitions" -- for those interested in security.

>BTW, before we change compression programs, we should do a survey of the
>available options, so that we can choose the best one, and be convinced
>that there is enough reason to change.  I know of at least Zoo, LHa,
>yabba, and freeze as possible options.  However, all of these suffer
>from the fact that they are not supported, or at least not supported to
>the degree that zip and unzip are.  Most (all?) of them are one man
>projects, while zip and unzip are a product of a larger number of people
>(the INFO-ZIP mailing list).

I agree.  I just did a quick test compressing small files:

	tar -cf inc.tar    /usr/include 	= 317440 bytes
	tar -cfz inc.tar.Z /usr/include		= 100745 bytes
	zip -r inc /usr/include			= 165943 bytes 
	tar -cf - /usr/include | zip inc2 -	=  65171 bytes

While tar | compress is superior for small files, over plain Zip
on small files, tar | zip still gives a 30% - 40% improvement.
This is 30 to 40 percent less disk space and even more important
30 to 40 percent less bandwidth.

If you haven't guessed yet, my vote goes to the "tar|zip" combination.
I feel that Zip is the best I have found todate.  I look forward to
what others have to say.
-- 
If any given program runs correctly, it is obsolete.
=========================================================================
Andrew Lawrence, Informaticien Conseil           |  alawrenc@sobeco.com
3605 St-Urbain, #1605                            |  uunet!sobeco!alawrenc