Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'more /rsrc info' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
more /rsrc info
Authored by: maclaw on Feb 24, '02 03:00:27PM

The /rsrc convention has been used all along in OS X and is not dependent on the developer's tools. Anyone with a BSD install can type ls -l */rsrc and see the (normally hidden) resource forks, or ls -l * */rsrc to see the visible data files with their accompanying resource fork, if any.

This is the reason why it is necessary to use "ditto -rsrc" when copying a folder that contains classic-style mac documents or applications. Mac files have historically been two files bound together (an overly simple explanation). Because Unix does not use resource forks, the standard Unix command "cp" will only copy the visible data file ("fork") but not retain the accompanying resource file ("fork"). This will render a classic app useless (menus and the such are often contained in a resource fork) and will probably strip your document files of various preference info such as creator, type, last window position, etc.

ditto -rsrc does not require the developer's tools -- it is included with the standard BSD install. If you have installed the developer's tools, you will also have CpMac and MvMac which are resource-fork-aware versions of cp and mv.



[ Reply to This | # ]
more /rsrc info
Authored by: ret on Feb 25, '02 03:03:11AM

I have been caught by this before - using cp and losing the resource info. So are there any inherent issues in aliasing or soft-linking cp and mv to CpMac and MvMac so that they are always used in preference to /bin/cp and /bin/mv?



[ Reply to This | # ]
more /rsrc info
Authored by: mervTormel on Feb 25, '02 03:21:08AM

beware! CpMac and MvMac seem to be deprecated tools with no docs and very wonky results.

http://forums.macosxhints.com/showthread.php?s=&threadid=762

probably best to use ditto for all your sundry file needs. it works well, is documented and supported.



[ Reply to This | # ]
more /rsrc info
Authored by: tochoa on Feb 25, '02 11:11:20PM

Yes- CpMac and MvMac are useful, but beware of using them with a -r switch on directory copying / moving. They will make all dot files you've moved visible at the destination. So soft linking them to cp and mv, is not a good idea! Better to use these cl tools on individual files, that you know will have resource forks (an example would be files that open in classic only applications, such as Quark.)



[ Reply to This | # ]
more /rsrc info
Authored by: daniel_steffen on Feb 25, '02 11:57:09AM
note that foo/rsrc is obsolete and might go away in the future, the official [1] way to access forked files in HFS+ is via foo/..namedfork/forkname, most files only have foo/..namedfork/data and foo/..namedfork/rsrc, but HFS+ supports an unlimited number of named forks, which can be created using the FSCreateResourceFile Carbon API [2].

[ Reply to This | # ]