We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
我发现的最好的库是
libarchive
。 它设计精良,文档齐全,而且速度很快。我刚刚在 GitHub 上创建了一个存储库,其中包含将
libarchive
和libbz2
构建为 iOS 4.2+ 静态库的工具。 (也应该可以使用它来定位 3.x。)http://github.com /davepeck/iOS-libarchive/
其他人指出
libarchive
包含在 SDK 中。 这并不完全正确。 包含二进制libarchive.2.dylib
,但不包含标头。 这同样适用于libbz2
(但奇怪的是,不适用于libz
。)这意味着libarchive
被视为私有API——换句话说,如果您打算在 App Store 上发布,则无法使用它。 因此我的存储库。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
andlibbz2
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/
Others have pointed out that
libarchive
is included in the SDK. This is not quite true. The binarylibarchive.2.dylib
is included, but the headers are not. The same applies tolibbz2
(but, oddly, not tolibz
.) This means thatlibarchive
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.事实上,libarchive.dylib 包含在 iPhone SDK 中。 您只需添加它即可。 问题是Apple 不知何故没有包含头文件archive.h。 但是,首先,如果您确定要调用的函数存在(尽管编译器会抱怨),则不需要头文件;其次,如果您不想让编译器抱怨,则可以下载头文件libarchive 2.6 并将其包含在您的程序中...
如果您想了解如何使用 libarchive,请从网络下载其源代码并研究给出的示例(尤其是 minitar)。 这确实非常简单。
In fact, libarchive.dylib is included in the iPhone SDK. You just have to add it. The problem is that somehow Apple did not include the header file archive.h. However, first, you do not need the header files if you know for sure the functions you are going to call exist (though the compiler will whine), second, if you do not want the compiler to complain, you can download the header file for libarchive 2.6 and include it in your program ...
If you want to know know to use libarchive, download its source from the web and study the example given (especially minitar). It is really very straightforward.
您可以尝试 libxad。 这是 Mac 应用程序 The Unarchiver 使用的库。
You might try libxad. This is the library that The Unarchiver, a Mac app, uses.
更好的链接:http://code.google.com/p/libarchive/downloads/detail?name=libarchive-2.6.2.tar.gz&can=2&q=
版本 2.6.2 包含在iOS 4.0 和 4.1 SDK。 它在 3.2 中不存在(或者我认为更早的版本)。
如果您下载了该文件,请运行
./configure --prefix=$HOME && 制作&& make install
你会发现两个头文件放置在 $HOME/include 中Even better link: http://code.google.com/p/libarchive/downloads/detail?name=libarchive-2.6.2.tar.gz&can=2&q=
Version 2.6.2 is included in the iOS 4.0 and 4.1 SDK's. It's not present in 3.2 (or earlier I assume).
If you download that, run
./configure --prefix=$HOME && make && make install
and you'll find the two header files placed in $HOME/include对于 libarchive,只需将“libarchive”添加到框架列表中即可开箱即用,但缺少标头。 您可以从 libarchive 源复制标头。 或者,如果您想保持简单,请尝试以下操作:
我只关心阅读,因此我不关心某些 archive_entry.h 突变函数。 另外,一些方法被注释掉了。 这些是不同版本的替代方案,#ifdef 已被淘汰。 祝你好运,狩猎愉快!
以下是使用它将存档解压到 ios 上的目录的示例:
--- Dave
For libarchive, it works out of the box by just adding "libarchive" to your framework list, but the header is missing. You can copy the headers from the libarchive source. Or if you want to keep it simple, try this:
I only cared about reading so I didn't bother with some of the archive_entry.h mutation functions. Also, a few of the methods are commented out. Those are the alternates for different versions that get #ifdef'd out. Good luck and good bug hunting!
Here's a sample of using it to unpack an archive to a directory on ios:
--- Dave
iOS 上预装了 libarchive。
libarchive comes preinstalled on iOS.
似乎有两个更现代的库,它们都可以作为 Cocoapods 提供:
它们都非常相似,因为它们都基于 Light-Untar-for-iOS< /a>.
There seem to be two more modern libraries, both of them available as Cocoapods:
Both of them are very similar, as they are both based on Light-Untar-for-iOS.