Article View: news.software.nntp
Article #56778Re: [yEnc] Survey time! (Compression or not?)
From: Russ Allbery
Date: Fri, 22 Feb 2002 05:35
Date: Fri, 22 Feb 2002 05:35
39 lines
2924 bytes
2924 bytes
Curt Welch <curt@kcwc.com> writes:
> It turns out I read that correctly. zlib and zip are NOT the same.
That's correct.
> zlib and gzip are bascially all the same, but, zlib compression format
> is NOT the same as gzip _file_ format. The gzip file format is the zlib
> compressed data format wrapped with extra headers and a CRC-32.
You can do that if you want, if you intentionally use the low-level zlib
routines, but the standard zlib calls write gzip files. It's basically
the same as the output of gzip. I use this all the time as part of my
job; I know it's true.
gzip has absolutely nothing to do with zip, however.
> The gzip _file_ format is documented in rfc1952. It acts like a simple
> file archive format and is a wrapper for the zlib data format. It adds
> headers which includes a 2 byte magic number, and the file size, and can
> include a file name, a date, and a comment field, and then adds a CRC32
> checksum at the end. This allows you to combine multiple compressed .gz
> files together simply be concatenation. This is explained on the man
> page but I never noticed it.
zlib writes RFC 1952 files, although it doesn't include the timestamp
information.
> So, if you take the zlib compression routines, and use them to compress
> a file, and write it disk, gzip WILL NOT be able to read it.
Nope. Try it.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID:
<ylr8ne6pve.fsf@windlord.stanford.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!nntp.stanford.edu!not-for-mailReferences:
<a504os$736$6@pegasus.csx.cam.ac.uk> <200220022141483852%planb@newsreaders.com> <20020220230116.405$a3@newsreader.com> <1014270020.729921@ok-corral.gunslinger.net> <20020221152617.647$FV@newsreader.com> <a53ut8$7i4$4@pegasus.csx.cam.ac.uk> <20020221183904.819$lz@newsreader.com> <yleljecpr8.fsf@windlord.stanford.edu> <20020221224023.453$bg@newsreader.com>Show Full Headers
Complete Article Headers
Message-ID: <ylr8ne6pve.fsf@windlord.stanford.edu> Subject: Re: [yEnc] Survey time! (Compression or not?) Date: Thu, 21 Feb 2002 21:35:01 -0800 From: Russ Allbery <rra@stanford.edu> References: <a504os$736$6@pegasus.csx.cam.ac.uk> <200220022141483852%planb@newsreaders.com> <20020220230116.405$a3@newsreader.com> <1014270020.729921@ok-corral.gunslinger.net> <20020221152617.647$FV@newsreader.com> <a53ut8$7i4$4@pegasus.csx.cam.ac.uk> <20020221183904.819$lz@newsreader.com> <yleljecpr8.fsf@windlord.stanford.edu> <20020221224023.453$bg@newsreader.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!nntp.stanford.edu!not-for-mail Newsgroups: news.software.nntp Organization: The Eyrie Lines: 38 NNTP-Posting-Host: windlord.stanford.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.Stanford.EDU 1014356102 211 171.64.13.23 (22 Feb 2002 05:35:02 GMT) X-Complaints-To: news@news.stanford.edu User-Agent: Gnus/5.090005 (Oort Gnus v0.05) XEmacs/21.4 (Common Lisp, sparc-sun-solaris2.6) Cancel-Lock: sha1:BGTOwZGGq86lmu8vMG14TK5hBQ0=