At 12:38 -0500 12/5/02, Chris Nandor wrote:
You can access the resource fork of any file by appending "/..namedfork/rsrc" to its name. Here's an example with my Mac OS 9 system suitcase, which the Finder reports as about 15 MB in size. It actually has about 7 MB of data fork and 8 MB of resource fork:Does anyone know how to open a resource fork, with open(), sysopen(), POSIX::open(), etc.? On Mac OS, I would use O_RSRC, but that is apparently not available in Mac OS X's fcntl.h.
[bh2065:/System Folder] adam% ls -l System
14900 -rwxrwxrwx 1 adam admin 7193280 Nov 11 17:45 System*
[bh2065:/System Folder] adam% ls -l System/..namedfork/rsrc
14900 -rwxrwxrwx 1 adam admin 8059739 Nov 11 17:45 System/..namedfork/rsrc*
Similarly, here's a find command to find all files in the current directory with a resource fork (actually, all files with a resource fork of nonzero size):
find . \( -type f -and -exec test -s \{\}\/..namedfork\/rsrc \; \) -print
We used to use "/rsrc" appended to the name, but this has been deprecated in favor of "/..namedfork/rsrc". (Although /rsrc still works in Jaguar.)
adam
