Objective-C Library Providing A Clean Syntax For Unarchiving Zip, Rar, And 7zip Files

I’ve mentioned a number of libraries for working with the most common file compression formats in a previous post a couple of years ago.

Here’s a library that puts many open source archiving libraries altogether in a single API with a library called SARUnArchiveANY submitted by Saravanan.

SARUnArchiveANY provides a clean syntax with a blocks based syntax for easily easily unarchiving .zip, .rar, and .7z files.

Here’s a syntax example from the readme:

SARUnArchiveANY *unarchive = [[SARUnArchiveANY alloc]initWithPath:filePath];
unarchive.destinationPath = destPath;//(Optional). If it is not given, then the file is unarchived in the same location of its archive file.
unarchive.completionBlock = ^(NSArray *filePaths){
  NSLog(@"For Archive : %@",filePath);
    for (NSString *filename in filePaths) {
        NSLog(@"File: %@", filename);
    }
};
unarchive.failureBlock = ^(){
    NSLog(@"Cannot be unarchived");
};
[unarchive decompress];

You can find SARUnArchiveANY on Github here.

A very clean way to handle unarchiving multiple file formats.

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Objective-C Library Providing A Clean Syntax For Unarchiving Zip, Rar, And 7zip Files

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

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