views:

226

answers:

2

hi,

Is it possible to use the bare minimum zlib available on iPhone to uncompress a zip of a folder. I don't want to go for a open source library, please enlighten me the difficulty or possibility of implementing one piece of code which can uncompress a zip file.

+1  A: 

zlib does not directly support the .zip file format, sorry.

It can be done though, contrib/minizip in the zlib distribution provides an example. (link to code: http://cvsweb.xfree86.org/cvsweb/utils/zlib/contrib/minizip/miniunz.c?rev=1.1&content-type=text/vnd.viewcvs-markup )

I'm unsure why you're against open source libraries, but http://bitbucket.org/kolpanic/zipkit/wiki/Home is a great solution.

JosephH
ZipArchive is based on minizip its very good
hib
+2  A: 

As JosephH said, you cannot use ZLib to deal with .zip files.

But you can use the MiniZip library for that: http://www.winimage.com/zLibDll/minizip.html

There's already an Objective-C wrapper, if you don't want to write yours: http://code.google.com/p/ziparchive/

FYI - ZLib on iPhone:

Adds libz to the linked frameworks of your main target, just as another framework.

Then, you can check the ZLIB tutorials, to learn how to compress/decompress a file: http://www.zlib.net/zlib_how.html

Macmade