Is there a simple example of how to unzip a .zip file and extract the files to a directory? I am currently using zlib, and while I understand that zlib does not directly deal with zip files, there seems to be several additional things in zlibs’s “contrib” library. I noticed and read about “minizip”, and after reading some documents and looking at some of the code, I do not see a simple example of how to unzip a .zip file and extract the files to a directory.
I would like to find a platform independent way of doing so, but if that is not possible then I need to find a way for windows and mac.
zlibhandles the deflate compression/decompression algorithm, but there is more than that in a ZIP file.You can try libzip. It is free, portable and easy to use.
UPDATE: Here I attach quick’n’dirty example of libzip, with all the error controls ommited: