Open Source Libraries And Examples For Zip, Rar, and 7-Zip Compression

Lately I have seen zip,  rar, and 7-zip compression related topics being searched for on this site.  Since those searches are coming up empty thought it would be a good idea to post about some of the available libraries, and examples related to these common desktop compression methods.

Here are some open source alternatives for handling these common compression types:

ZipKit – This is an Objective-C .zip compression library from Karl Moskowski that can handle the standard PKZip format. You can perform all the expected zip functions, and interrupt the compression cleanly so you can run your unzipping in a separate thread, and cancel if neccessary without any issues.  An example project is included – be sure to check the documentation wiki for examples on how to include this library within your apps.

Unrar4iOS – From  Rogério Araújo this is an example that includes the C++ Portable Unrar project and provides a working demonstration showing how view the contents of a rar file, and extract files using Objective-C.

7-Zip Lzma SDK – This is a multi-language SDK for handling 7-zip files.  Mo Dejong has created an example demonstrating how to use the LZMA SDK to decompress 7-zip libraries on iOS devices.  You can find the example on his website here.

If you are looking for info on how to handle gzip compression theis NSDATA extension from CocoaDev that were mentioned in an iTunes File Sharing tutorial will allow you to handle gzip compression easily.  No library downloads required as only Zlib is used.

While I know there are other alternatives (especially for .Zip) these examples and frameworks should get you started for handling these compression types.

©2011 iPhone, iOS 4, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.

.

DeliciousTwitterTechnoratiFacebookLinkedInEmail


Leave a Reply

Your email address will not be published. Required fields are marked *