Article View: gnu.utils.bug
Article #1346gzip vs. zip (was: gzip0.8.1 will not unzip unix-zipped files)
From: Jean-loup Gailly
Date: Wed, 27 Jan 1993 03:02
Date: Wed, 27 Jan 1993 03:02
59 lines
2937 bytes
2937 bytes
Ken-ichiro Aoki <aoki@madonna.physics.ucla.edu> writes:
> when I use unix-zip and try to unzip using gunzip, I get the following.
> g.zip: first entry not deflated or stored--can't extract
See comment in unzip.c:
This version can extract files in gzip or pkzip format.
For the latter, only the first entry is extracted, and it has to be
either deflated or stored.
I apologize for forgetting to document this restriction in gzip.1 and
gzip.info. The intent was only to be able to extract old tar.zip files
containing a single deflated entry, made with:
tar cf - . | zip > foo.tar.zip
Such files should now be replaced with tar.z files, made with:
tar cfz foo.tar.z .
To extract other zip files (with several members or different compression
methods), use unzip. zip and gzip serve different purposes and I don't
have the intention of merging them.
Since many people have asked me this question, here is a quick comparison
of zip and tar+gzip:
- "tar -z" (tar+gzip) compresses a tar file into a single stream. To
extract one specific member (with "tar xfz foo.tar.z member) gunzip
decompresses the whole tar.z file and passes that to tar. This method
improves compression since gzip can take advantage of redundancy between
files.
- zip compresses file members independently. unzip is then able to seek
directly to the proper location for extraction of a single member.
This method degrades compression but enables recovery in case of
damage to a portion of the zip file. If a tar.z file is damaged, all
data after the error is lost.
- the current version of zip does not store uid and gid, and compresses hard
links several times. tar works correctly.
- unzip has many tricks to convert file names from one system to another,
restore special file attributes (for VMS and OS/2), etc... gzip is
only a data compression program, and I want to keep it simple.
I am thinking of adding an optional block size parameter to gzip to
improve error recovery (see the file TODO in the gzip 0.8.1 distribution).
> zip I used was Zip 1.0 (29 September 1991)
Get zip 1.9p1 and unzip 5.0p1:
oak.oakland.edu:/pub/misc/unix/zip19p1.tar-z
oak.oakland.edu:/pub/misc/unix/unz50p1.tar-z
Jean-loup Gailly
jloup@chorus.fr
Technical Details
Message-ID:
<1887@chorus.chorus.fr>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!chorus.FR!jloupReferences:
<9301250305.AA09842@madonna.physics.ucla.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!chorus.FR!jloup From: jloup@chorus.FR (Jean-loup Gailly) Newsgroups: gnu.utils.bug Subject: gzip vs. zip (was: gzip0.8.1 will not unzip unix-zipped files) Date: 26 Jan 1993 22:02:36 -0500 Organization: GNUs Not Usenet Lines: 60 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-utils@prep.ai.mit.edu Distribution: gnu Message-ID: <1887@chorus.chorus.fr> References: <9301250305.AA09842@madonna.physics.ucla.edu> Reply-To: jloup@chorus.fr (Jean-loup Gailly)