Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daltoniam/tarkit
untar and tar files on iOS and OS X. Also supports gzip tars.
https://github.com/daltoniam/tarkit
Last synced: about 2 months ago
JSON representation
untar and tar files on iOS and OS X. Also supports gzip tars.
- Host: GitHub
- URL: https://github.com/daltoniam/tarkit
- Owner: daltoniam
- License: apache-2.0
- Created: 2014-05-21T17:32:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-08-10T14:11:16.000Z (over 4 years ago)
- Last Synced: 2024-10-31T15:45:08.522Z (2 months ago)
- Language: Objective-C
- Size: 38.1 KB
- Stars: 89
- Watchers: 5
- Forks: 25
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
tarkit
======untar and tar files on iOS and OS X. Also supports gzip tars.
## Example
## Untar
```objc
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
```objc
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:
- [Light-Untar-for-iOS](https://github.com/mhausherr/Light-Untar-for-iOS)
## 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 ###
* https://github.com/daltoniam
* http://twitter.com/daltoniam
* http://daltoniam.com