doomspork
doomspork

Reputation: 2342

How to compress a directory with NSData Category?

I've been playing with an app and I wanted to add the ability to compress a directory and it's children. I found the CocoaDev category often mentioned on here but eventually settled on the category put together for Molecules. My problem is less with the compression category and more with converting a directory into a valid NSData object. I want people to be able to deflate the file with any app out there. I have looked into NSFileManager and serializing the directory contents and compressing that, but I suspect this would prohibit the archive from being deflatable.

Where am I going wrong? Would NSData not be sufficient?

Upvotes: 3

Views: 971

Answers (1)

justin
justin

Reputation: 104698

sounds like zip -r (more arguments here) may work for you.

Upvotes: 1

Related Questions