zlib directly for uncompressing a zip folder for iphone

痴心易碎 提交于 2019-12-21 21:08:07

问题


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:


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




回答2:


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.



来源:https://stackoverflow.com/questions/3228530/zlib-directly-for-uncompressing-a-zip-folder-for-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!