[comp.sys.mac] Need Varification on fix made for PBHCreate

smethers@psu-cs.UUCP (Paul Smethers) (12/16/87)

We have been debugging some strange behavior associated with calling PBHCreate
where the file created would "disappear" to the standard file package.

Tech Note 102 says that if we don't set the ioFlVersNum to zero, this will
happen (it also says that this will only happen on MFS, yet we are using HFS).
Well, we did this and it still happened.  So we tried setting ioFVersNum to
zero, and the problem went away.

Can some Apple Guru (that's probably you Larry) please make a statement from
Apple that says that this was the case and proper fix so that we don't have
our code later causing new versions of the file system to wig out?

Paul Smethers
SmethersBarnes


/* Also, we did notice a note in Inside Mac IV (p. 120) that said that the
ioParam.ioVersNum should be zero.  Does this carry on for ioFVersNum in the
fileParm variant?  Furthermore, for PBCreate (not PBHCreate), ioFVersNum is
considered to be an input, but is left out for PBHCreate.  Was it supposed
to be an input for PBHCreate also? */

/*  Isn't programming the mac fun :-) */

lsr@apple.UUCP (Larry Rosenstein) (12/18/87)

In article <458@psu-cs.UUCP> smethers@psu-cs.UUCP (Paul Smethers) writes:
>
>Tech Note 102 says that if we don't set the ioFlVersNum to zero, this will
>happen (it also says that this will only happen on MFS, yet we are using HFS).
>Well, we did this and it still happened.  So we tried setting ioFVersNum to
>zero, and the problem went away.

I think I understand the problem (we ran into a similar thing with MacApp).

The key point is that the call PBHCreate (or any of the HFS-version calls)
are exactly the same as the non-HFS versions (eg, PBCreate) if you are
running on a machine without the HFS code or if you are dealing with an MFS
volume.  MFS volumes do store the file version number, but HFS volumes
don't.

So even if you specify all the field required by the PBHCreate call, the
call might be treated as if it was a PBCreate call.  If you look under
PBCreate, you will notice that ioFVersNum is an input parameter.  Therefore,
to make sure your code works with MFS disks, you should always set
ioFVersNum to 0.

There is not problem with setting this field all the time.  If the volume is
an HFS volume, it will be ignored; otherwise it will be used.  

>/* Also, we did notice a note in Inside Mac IV (p. 120) that said that the
>ioParam.ioVersNum should be zero.  Does this carry on for ioFVersNum in the
>fileParm variant?  Furthermore, for PBCreate (not PBHCreate), ioFVersNum is
>considered to be an input, but is left out for PBHCreate.  Was it supposed
>to be an input for PBHCreate also? */

You have to make sure either or both version number fields are set to 0, if
the call requires it.  Technically, PBHCreate doesn't use the version
number, except that a PBHCreate called will execute as if it was a PBCreate
call, if the volume is MFS.  So in that sense, the Inside Mac should have
included ioFVersNum in the description of PBHCreate.

-- 
Larry Rosenstein

Object Specialist
Apple Computer

AppleLink: Rosenstein1
UUCP:  {sun, voder, nsc, mtxinu, dual}!apple!lsr
CSNET: lsr@Apple.com