Jan 15, '04 09:03:00AM • Contributed by: Anonymous
The answer: the ditto command. After some experimentation, I found that ditto with the following options will create an archive just like the "Create Archive of ..." function:
ditto -c -k -keepParent -rsrc source destination
where source is the file or directory you want to archive and destination is the name you want to give the new archive file. For example, to create an archive of a directory named Foo to a file named Foo.zip, use:
ditto -c -k -keepParent -rsrc Foo Foo.zip
[robg adds: We've covered ditto before, and the above syntax was included in a handy folder action script hint, but I thought it might be worth sharing the command-line version in its own hint.]
