Skip to content

Latest commit

 

History

History
58 lines (37 loc) · 1.6 KB

README.md

File metadata and controls

58 lines (37 loc) · 1.6 KB

tarkit

untar and tar files on iOS and OS X. Also supports gzip tars.

Example

Untar

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* dataPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"test.tar.gz"];
NSString* toPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"testDir"];
[DCTar decompressFileAtPath:dataPath toPath:toPath error:nil];

##Tar

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* toPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"test.tar.gz"];
NSString* dataPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"testDir"];
[DCTar compressFileAtPath:dataPath toPath:toPath error:nil];

Discussion

It is important to know that all the file system based tar commands used chunked/buffer methods to save memory. Due to the fact that tars are normally used to compress lots of content, It is strongly recommend to use those method versus the in memory data options.

Credit

I got some of the tar code from here:

Install

The recommended approach for installing tarkit is via the CocoaPods package manager (like most libraries).

pod 'tarkit', '~> 0.1.3'

Requirements

tarkit requires at least iOS 5/OSX 10.7 or above.

License

tarkit is license under the Apache License.

Contact

Dalton Cherry