I’m looking for exactly what the title says- a Cocoa library with the ability to list files in a ZIP, and extract single files upon request. These features are ‘unzip -l’ and ‘unzip $archive $filename’ commands respectively- I’m looking for a framework/API to do this, something like Java’s ‘java.util.zip’.
It seems that the logical fallback is to use NSTask to call the command line ‘unzip app’, and am willing to use this. However, I thought it might be better to look for a non-NSTask solution first.
http://code.google.com/p/objective-zip/
Read file out
List files inside
Note about direcotry structure
Please note that inside the zip files there is no representation of a file-folder hierarchy: it is simply embedded in file names (i.e.: a file with a name like
x/y/z/file.txt). It is up to the program that extracts the files to consider these file names as expressing a structure and rebuild it on the file system (and viceversa during creation). Common zippers/unzippers simply follow this rule.from manual