tags:

views:

399

answers:

2

Hi, I have a zipped file, which i want to extract the contents of it. What is the exact procedure that i should do to achieve it. Is there any framework to unzip the files in cocoa framework or objective C.

+1  A: 

Try Zip.framework.

Graham Lee
A: 

If you just want to uznip the file, I would recommend using NSTask to call unzip(1). It's probably smart to copy the file to a directory you control -- probably in /tmp -- before unzipping.

Colin Barrett
You don't control /tmp, anyone can write to it.
Graham Lee
Graham: But it's a fine place to do temporary work to avoid clobbering an existing folder.
Colin Barrett
Thanks it did work.
iSight
Use `NSTemporaryDirectory()` instead of `/tmp`, although be careful, it behaves a little more like `/var/tmp`. It will get cleaned out, but it is not always at a reboot.
dreamlax