Xref: utzoo comp.protocols.appletalk:1118 comp.sys.mac.programmer:3097 Path: utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!fluke!jeff From: jeff@tc.fluke.COM (Jeff Stearns) Newsgroups: comp.protocols.appletalk,comp.sys.mac.programmer Subject: What's the format of an AppleDouble resource file? Keywords: AppleDouble resource GatorBox Cayman Apple Macintosh file format Message-ID: <5918@fluke.COM> Date: 10 Nov 88 00:11:54 GMT Sender: news@tc.fluke.COM Organization: John Fluke Mfg. Co., Inc., Everett, WA Lines: 52 Apple has defined a "standard" way of storing Macintosh files on primitive UNIX-like computers which don't support the concept of resource forks. It's called AppleDouble, and it cleaves the Macintosh file into two parts for storage on UNIX. The data fork is stored byte-for-byte in one file, and the resource fork is stored in another. (The resource fork file is named "%file".) The %file is always 256 bytes larger than the resource fork of the Macintosh file istelf. There's a second standard called AppleSingle, which stores the two forks in one UNIX file, it apparently includes some header information necessary to separate the two forks later. Now the question: What's the exact format of those extra 256 bytes of an AppleDouble '%' resource file? And what is the format of an AppleSingle file? For example: Imagine a Microsoft Word file named "My Word File". The data fork contains 25088 bytes; the resource fork contains 0 bytes. If stored on a UNIX filesystem in AppleDouble format, it would be split into two files; the 25088 bytes of the data fork would be stored in "My Word File". No surprises there. Now the 0-byte resource fork is stored into a file named "%My Word File", but this UNIX file contains 256 bytes of magic stuff. Some bytes are obvious strings, but there are plenty of inscruitable numbers. What do those bytes mean? For your amusement, here's a real-life sample: 0000 0 5 16 7 0 1 0 0 4d 61 63 69 6e 74 6f 73 | ........Macintos 0010 68 20 20 20 20 20 20 20 0 3 0 0 0 9 0 0 | h ........ 0020 0 80 0 0 0 40 0 0 0 7 0 0 0 c0 0 0 | .....@.......... 0030 0 10 0 0 0 2 0 0 1 0 0 0 0 0 0 0 | ................ 0040 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ................ 0050 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ................ 0060 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ................ 0070 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ................ 0080 57 44 42 4e 4d 53 57 44 1 0 ff ff 0 7d 0 0 | WDBNMSWD.....}.. 0090 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ................ 00a0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ................ 00b0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ................ 00c0 eb 6 65 26 eb b 67 ec 80 0 0 0 0 0 0 0 | ..e&..g......... 00d0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ................ 00e0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ................ 00f0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ................ -- Jeff Stearns John Fluke Mfg. Co, Inc. (206) 356-5064 jeff@tc.fluke.COM {uw-beaver,microsoft,sun}!fluke!jeff PS - Calling all users of the Vitalink TransLAN IV Ethernet bridge! Please drop me a line.