[hfs-user] Catalog Thread record size ?

Simon Bazley sibaz@sibaz.com
Tue, 16 Apr 2002 11:04:20 +0100


I think we're confusing hfs and hfs+, hfs has a fixed name size, thats lots less
that 256 (I should have noticed your 256 wasn't 20 something).
On hfs+ file names are variable, so while it may say something in the book,
thats a maximum size.

The figure they quote as a minimum size for lots of things (due to maximum name
lengths) is 4k.

This is all discussed in detail in the hfs+ tech doc

Entwicklung wrote:

> Yes, but if you look at the definitions below  : UniChar has been defined as
> UInt16 - since Multibyte Unicode is being used for HFS+  - So every
> character takes up 2 Bytes in BigEndian format .
>
> So the HFSUniStr255 structure has actually 256 units of 2 Bytes
> each -including the length - please correct me if I'm wrong or you think
> otherwise.
>
> Regards,
> Nandini
>
> ----- Original Message -----
> From: "Simon Bazley" <sibaz@sibaz.com>
> To: "Entwicklung" <entwicklung@whengenibk.de>
> Cc: <hfs-user@lists.mars.org>
> Sent: Tuesday, April 16, 2002 10:57 AM
> Subject: Re: [hfs-user] Catalog Thread record size ?
>
> > Why would you want to multiply 256 by 2? a byte is 1, a char is 1,
> > therefore 256 chars are 256.
> >
> > Entwicklung wrote:
> >
> > > Hello,        I just have a question regarding the size of the HFS
> > > Plus - Catalog Thread Record specified in the Apple Universal
> > > Interfaces headers - typedef UInt16                UniChar; /*
> > > HFSUniStr255 is the Unicode equivalent of Str255 */
> > > struct HFSUniStr255 {
> > >   UInt16               length;                 /* number of unicode
> > > characters */
> > >   UniChar             unicode[255];           /* unicode characters */
> > >
> > > }; /* HFS Plus catalog thread record -- 264 bytes */
> > > struct HFSPlusCatalogThread {
> > >   UInt16                      recordType;             /* record type
> > > */
> > >   UInt16                      reserved;               /* reserved -
> > > set to zero */
> > >   HFSCatalogNodeID    parentID;               /* parent ID for this
> > > catalog node */
> > >   HFSUniStr255           nodeName;               /* name of this
> > > catalog node (variable length) */
> > > };
> > > typedef struct HFSPlusCatalogThread     HFSPlusCatalogThread; Based on
> > > the above declarations shouldn't the size for the HFSPlus catalog
> > > thread record be 2+2+4 (since CNID's are 4 bytes long ) + 256*2 =
> > > 264+256 instead of 264 as mentioned above ? I think someone probably
> > > forgot to multiply the 256 by 2 but I just wanted to make sure that is
> > > an error. I'd be happy to hear some feedback from the list wrt
> > > this. Best Regards,Nandini Hengen
> >