Main Page | Report this Page
 
   
Science Forum Index  »  Compression Forum  »  Using zlib to unzip .ZIP files
Page 1 of 1    
Author Message
Guest
Posted: Mon Apr 14, 2008 9:20 am
Can zlib be used to unzip .ZIP files? I tried using untgz_d.exe to
unzip test .ZIP file and get "broken archive" message. Same test file
can be unzipped with pkunzip.exe successfully.
Mark Adler
Posted: Mon Apr 14, 2008 9:52 am
Guest
On Apr 14, 12:20 pm, John_...@inbox.ru wrote:
Quote:
Can zlib be used to unzip .ZIP files?

In general, yes, but you have to write your own code to parse the zip
file format (or you can use the contributed code in the zlib
distribution in the contrib/minizip directory). The zip format is
documented here: http://www.pkware.com/documents/casestudies/APPNOTE.TXT

The zip format allows several different compression methods. zlib
only provides support for the deflate method (also the deflate64
method, again in the contrib directory). So in theory, you would need
other decompressors to handle any zip file that might come your way.
However in practice, nearly all zip files use deflate exclusively, for
portability.

Mark
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Fri Jul 04, 2008 10:59 pm