Skip to content

vittoriom/Light-Untar-for-iOS

 
 

Repository files navigation

Light Untar for iOS

Purpose

Why this code?

https://blog.octo.com/en/untar-on-ios-the-pragmatic-way/

What this code will do:

  • Extract files and directories created with the tar -cf command
  • Work with 512 block or multiple (tar -b512 or just tar)

What this code will not do:

  • Extract compressed files and directories created with the tar -czf command
  • Work with unix right and ownership
  • Work with no standard block size

##How to use

NSData* tarData = [NSData dataWithContentsOfFile:@"/path/to/your/tar/file.tar"];
NSError *error;
[[NSFileManager defaultManager] createFilesAndDirectoriesAtPath:@"/path/to/your/extracted/files/" withTarData:tarData error:&error];

Remember that you can't write outside your app directory

About

Very light and pragmatic untar utility for iOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 94.3%
  • Ruby 3.3%
  • Shell 2.4%