Editing resource forks on the command line on Mac OS X
Asked Answered
T

4

13

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 fork on the command line in Mac OS X?

Tranship answered 22/11, 2008 at 2:19 Comment(0)
P
12

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

Phylloquinone answered 22/11, 2008 at 12:45 Comment(0)
S
10

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)

Shroyer answered 22/11, 2008 at 2:36 Comment(0)
I
1

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

ditto -rsrc srcFile dstFile

Incredulity answered 22/11, 2008 at 5:8 Comment(0)
P
1

If you're trying to add a rich text resource fork (for example, to display software license when mounting a .dmg), check out Rainer Brockerhoff's free AddLicense source code.

Photogrammetry answered 9/1, 2011 at 15:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.