问题描述
我正在编写一个从Web服务器下载tar-gzip文件的iPhone应用程序,然后需要取消归档此文件,以便将其复制到应用程序的Documents文件夹中。
I'm writing an iPhone app which downloads a tar-gzipped file from a Webserver, then needs to unarchive this file so that it can be copied into the app's Documents folder.
我正在使用tar / gzip,因为我想在一个HTTP请求中下载一大堆小文件,以使一切变得美观和快速。
I'm using tar/gzip because I want to download a whole bunch of small files in one HTTP request, to make everything nice and fast.
I已经调查了像这样的解决方案,但作为C / Objective-C newb,我无法让他们中的任何一个为iPhone平台编译。
I've investigated solutions like http://www.feep.net/libtar/, but as a C/Objective-C newb, I can't get any of them to compile for the iPhone platform.
(我觉得我应该能够进行系统调用到tar -zxvf myfile.tar.gz,但它看起来并不那么容易!)
(I felt like I should just be able to do a system call to "tar -zxvf myfile.tar.gz", but it would appear it's not that easy!)
所以有一种简单的方法可以解压缩文件在iPhone上?或者我是否认为这是错误的,有更好的方法吗?
So is there a simple way to just un-tar a file on the iPhone? Or am I going about this all wrong, and is there a better way to do this?
提前致谢!
Nik
推荐答案
此博文应该可以帮助您:
This blog post should help you:http://blog.hawkey.org/?p=332
编辑:实际上链接到链接到,包含一些在iOS上实现解压缩的代码。
Google cache version of the same page which actually links to a forum post here which links to a Google Code project here, containing some code which implements unzipping on iOS.
这篇关于"解压"在iPhone上的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!