tags:

views:

1082

answers:

3

Mac OS X stores some files with resource forks. I need to create a file with a resource fork. The trouble is, I need to create this file on the command line. Is anyone aware of how you can create a file with a resource form on the command line in Mac OS X?

+4  A: 

First, OS X doesn't really use resource forks... it supports named forks and HFS+ supports the resource forks, but that's mostly for backwards compatibility with OS 9 and old-style Carbon stuff... however, there are command line tools installed with the Developer Tools (so you'll have to install these... if you don't have them, you can get them from developer.apple.com).

See the man pages for the following tools:

ResMerger Rez RezDet RezWack

The man pages are installed with the developer tools, so

man Rez

in the terminal will work. The man pages are also available online:

Rez(1)

Jason Coco
A: 

As an alternative, you can make a copy of an existing file, fork and all, using ditto:

ditto -rsrc srcFile dstFile

e.James
+1  A: 

You can directly access the resource fork of a file using path/to/file/..namedfork/rsrc.

Ben Gottlieb