Article View: news.software.nntp
Article #56781Re: [yEnc] Survey time! (Compression or not?)
From: Curt Welch
Date: Fri, 22 Feb 2002 07:13
Date: Fri, 22 Feb 2002 07:13
52 lines
3510 bytes
3510 bytes
Russ Allbery <rra@stanford.edu> wrote: > 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. Ok, which low level routines? compress()/uncompress() or deflate()/ inflate() etc? It's obvious the gz* routines will be creating gzip file format. What does compress() create and what does deflate() create? I assumed both would be the same and both would be zlib format? > gzip has absolutely nothing to do with zip, however. That was just a typo on my part. I was trying to say gzip. > > 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. I was afraid my assumptions would be wrong agaon. Ok, Ok, I'll try it... No, it looks like I was right. The compress() and uncompress() zlib functions are not returning data in gzip format. It looks like zlib format. If I compress() "test\n" I get 13 bytes of compressed data. And when I run those 13 bytes though uncompress() I get back my 5 bytes. But when I save those to a file and try to run gunzip it just says "not in gzip format". But if I use the zlib routines for writing a gzip format file, it produces a 25 byte file which gunzip does understand. Sure looks to me like my guess about what the zlib routines are doing is correct. Does it work different for you? -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Technical Details
Message-ID:
<20020222021334.828$pl@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!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!portc.blue.aol.com.MISMATCH!portc03.blue.aol.com!feed1.newsreader.com!news2.newsreader.com!ellis.newsreader.com!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> <ylr8ne6pve.fsf@windlord.stanford.edu>Show Full Headers
Complete Article Headers
Message-ID: <20020222021334.828$pl@newsreader.com>
Subject: Re: [yEnc] Survey time! (Compression or not?)
Date: Fri, 22 Feb 2002 07:13:34 +0000
From: curt@kcwc.com (Curt Welch)
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> <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!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!portc.blue.aol.com.MISMATCH!portc03.blue.aol.com!feed1.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com 1BklBrwHBSCZ8k09Ilm_Ybsl=Q6jF0z0N2yEuxEK@-XWVCRs
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
%IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 51