Hello, The technical notes for HFS+ pg. 26 describes two fields userInfo and finderInfo of the structure HFSPlusCatalogFile as " This field contains information used by the Mac OS Finder. Its format is not part of the HFS Plus Specifications."
Can anybody who is familiar with the specifications please tell me if a third party HFS-generating application has to set these fields to 0 assuming them to be 'reserved' or what values exactly these should correctly take on? I'm relatively new to the Specs and would be grateful for some professional advice from the experts who work with the specs everyday.
Regards, Nandini Hengen
On Thursday, January 17, 2002, at 03:00 AM, Entwicklung wrote:
The technical notes for HFS+ pg. 26 describes two fields userInfo and finderInfo of the structure HFSPlusCatalogFile as " This field contains information used by the Mac OS Finder. Its format is not part of the HFS Plus Specifications." Can anybody who is familiar with the specifications please tell me if a third party HFS-generating application has to set these fields to 0 assuming them to be 'reserved' or what values exactly these should correctly take on? I'm relatively new to the Specs and would be grateful for some professional advice from the experts who work with the specs everyday.
If you don't want to fill in the fields, or don't know what to put there, use zeros. The Mac OS File Manager initializes those fields to zero when files or directories are created. The Finder or other applications typically change them later.
If you haven't already done so, you should probably download a copy of Apple's Universal Interfaces. It contains headers for C, Pascal, and 68xxx assembly. There are definitions for the structures used on HFS and HFS Plus. You can download them from: ftp://ftp.apple.com/developer/Development_Kits/UniversalInterfaces3.4.img. bin
Note that this is a MacBinary encoded disk image. If you're not using a Macintosh, it would probably be a lot easier to borrow a Mac to decode and mount the image, so you can copy the files off. Some or all of these headers may be available through the Darwin sources, but I haven't looked. You can also download the interfaces without the Pascal or assembly headers, but I find the assembly headers really convenient since they list the byte offsets of fields within structures (which is really handy when you're looking at a hex dump at a terminal or in a disk editor).
For example, in HFSVolumes.h, you'll find:
struct HFSPlusCatalogFile { SInt16 recordType; /* record type = HFS Plus file record */ UInt16 flags; /* file flags */ UInt32 reserved1; /* reserved - set to zero */ HFSCatalogNodeID fileID; /* file ID */ UInt32 createDate; /* date and time of creation */ UInt32 contentModDate; /* date and time of last content modification */ UInt32 attributeModDate; /* date and time of last attribute modification */ UInt32 accessDate; /* date and time of last access (Rhapsody only) */ UInt32 backupDate; /* date and time of last backup */ HFSPlusPermissions permissions; /* permissions (for Rhapsody) */ FInfo userInfo; /* Finder information */ FXInfo finderInfo; /* additional Finder information */ UInt32 textEncoding; /* hint for name conversions */ UInt32 reserved2; /* reserved - set to zero */
/* start on double long (64 bit) boundry */ HFSPlusForkData dataFork; /* size and block data for data fork */ HFSPlusForkData resourceFork; /* size and block data for resource fork */ };
That tells you that the userInfo field is of type FInfo, and finderInfo is of type FXInfo. You can find definitions of FInfo and FXInfo in Finder.h, where you'll also find FileInfo and ExtendedFinderInfo, which are alternative definitions that represent how current versions of Mac OS use those fields.
You can find more information in the Finder Interface chapter of Inside Macintosh: Macintosh Toolbox Essentials. I suggest looking at the following URL: http://developer.apple.com/techpubs/macos8/Files/FinderInterface/finderinterface. html
Probably the most import fields to set would be the type and creator of files. This is what Mac OS 9 and earlier use to determine the icon and application associated with a file. (Mac OS X uses additional mechanisms.)
-Mark