Get Updates By E-mail 

Article Written By:
Johann Dowa

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.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments