Our thinking


Unzip Mac OS X Archives from the Command-line

I was under the impression that most, if not all, OS X command-line utilities are resource-fork aware (where they need to be anyway)

It seems that this isn’t the case.

The Unzip command does not understand the way that BOMArchiveHelper stuffs resource forks into zip files, and just unzips the __MACOSX directory alongside the other files.

OK, so resource forks are dead and buried – well, not quite.

Fonts.

In particular, PostScript Type 1 Fonts, on the Mac, still use resource forks.

If you’ve created an archive with some fonts in the Finder, and want to unzip it on the command-line, simply running unzip filename.zip won’t do what you want it to.

You’ll instead need to use ditto:

ditto -xk Archive.zip .

This then works it’s magic on the __MACOSX directory, putting the resource forks back together with their files and everything is happy once more.

1 thought on “Unzip Mac OS X Archives from the Command-line

Leave a Reply