Editing resource forks on the command line on Mac OS X

巧了我就是萌 提交于 2019-12-05 00:42:42

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

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)

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

ditto -rsrc srcFile dstFile

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!