在Objective C中压缩文件夹 [英] Zipping a folder in Objective C

查看:110
本文介绍了在Objective C中压缩文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Objective C中是否有用于压缩整个文件夹(并将其解压缩)的库?我已经通过搜索查看了其中的一些文件,但是它们看起来好像需要单独添加文件,并且其中有些文件可能会崩溃...

Are there any libraries that work in Objective C for zipping entire folders (and decompressing them)? I have looked at some of them by searching but they look like they require adding files individually and some of them supposedly crash...

该库似乎可以工作: http://bitbucket.org/dchest/osxzip/overview

It looks like this library might work: http://bitbucket.org/dchest/osxzip/overview

但是我不知道它是否支持文件夹.有人知道它是否支持拉链文件夹吗?甚至与命令行libz交互的示例代码对我来说都很好...

I don't know if it supports folders, however. Anyone know if it does or have any other libraries that support zipping folders? Even sample code for interacting with the command line libz would be fine with me...

推荐答案

您可以使用NSTask运行命令行ditto程序.确保查看ditto手册页中正确的标志组合,以获取与Finder兼容的拉链.

You could use NSTask to run the command line ditto program. Be sure to look at the ditto man page for the right combination of flags to get Finder-compatible zipping.

这篇关于在Objective C中压缩文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆