user141302
user141302

Reputation:

tar extraction in iphone SDK?

how can i extract tar file in iphone Sdk?i tried both miniZip and libZ.dylib, it extracts only .gZ file. i decompressed my.tar.gZ file into my.tar.but how can i extract again tar file?any one can help?

Upvotes: 1

Views: 1911

Answers (3)

Mathieu Hausherr
Mathieu Hausherr

Reputation: 3485

I've a home maid solution for you: https://github.com/mhausherr/Light-Untar-for-iOS

It's lighter than lib archive and may work for your use.

Complete discussion about that: http://blog.octo.com/en/untar-on-ios-the-pragmatic-way/

Upvotes: 2

Dave Peck
Dave Peck

Reputation: 1352

The best library I've found is libarchive. It is well-designed, well-documented, and fast.

I just created a repository on GitHub that has the tools to build libarchive and libbz2 as static libraries for iOS 4.2+. (It should be possible to use it to target 3.x, too.)

http://github.com/davepeck/iOS-libarchive/

In other related questions on Stack Overflow, people have pointed out that libarchive is included in the SDK. This is not quite true. The binary libarchive.2.dylib is included, but the headers are not. The same applies to libbz2 (but, oddly, not to libz.) This means that libarchive is considered a private API -- in other words, you can't use it if you intend to ship on the App Store. Hence my repository.

Upvotes: 1

Alex Reynolds
Alex Reynolds

Reputation: 96967

Have you looked at libtar?

Upvotes: 0

Related Questions