Gideon King wrote:

1. Use NSTask to create a zip file, passing in as arguments all the filenames to zip. My question about this would be whether I would run into any restrictions with the length of the command which well be beyond the old 1024 character limits (not sure if any command line argument limits are still extant). I would think this would be the most efficient way to do it (both time and memory/storage wise), so long as there are no limitations on command line length.

Max argv size is defined by sysctl kern.argmax. It's at least 256K these days. I don't think it was ever as low as 1024.

Most archive tools have an option that tells them to read file-lists from stdin, one pathname per line.

If the archive format doesn't have to be pkzip, then consider using tar and gzip.

You could hard-link selected files into a temp-folder rather than copying them. Then unlink when you're done and no copies needed. You can't hard-link symlinks, though, so that may not work. However, pkzip has no encoding for symlinks, so you can't zip a symlink, anyway. Or are you using ditto to write the zip file?

  -- GG

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to