read zip file addon

hello everyone,

i want to read a zip file.
like unzipit library for P5 http://libraries.seltar.org/unzipit/.

anyone an answer?

hi

as far as i know, there is no zip library especially made for OF. But there are loads of libraries available for c++. The most famous is probably zlib http://www.zlib.net/
But you can find some more over here:
http://stackoverflow.com/questions/2628-…-pplication
http://stackoverflow.com/questions/1242-…–available

But those are not that easy to use. Maybe, if you only have to unzip or zip some files and are on mac or linux, you could also look at the command line application “unzip” or “zip”. You can call these commands from your openframeworks application. I may have the code somewehere on how to do a command line call if you need it.

regards
ph

i didn’t have enough time to get zlib working so i came up with another solution using a shell script which is called from OF and does all the unzipping.

for each zip file, i create a new folder which i name with the current timestamp.
i then use ofDirectory to check when the folder is created.
once created, i can assume the current files have been unzipped.
and i then go onto unzipping the remaining files in the folder using the same process.

007 source code below,
http://julapy.com/source/110929-unzip.zip

L.

Hey

I just posted this for future reference:
https://github.com/mazbox/ofxUnZip

one function that unzips a file to a specified destination

thx Marek,
works great.

one thing i needed to do is wrap with the zip file path with ofToDataPath();
perhaps this could be done automatically inside the ofxUnZip() function.

cheers,
L.