[comp.sys.mac.programmer] Converting Directory IDs to vRefNums

boerned@mist.cs.orst.edu (Dan Boerner) (03/27/90)

I'm trying to store the location of a user chosen folder.  I'm using some
apple sample code which puts up a custom SFGetFile dialog and returns
a DirID for the folder chosen.  My problem is that I want to store the 
folder's location as a partial pathname (folder name) and vRefNum.

Does anyone know how to convert the Dir ID into a vRefNum?

I played around with calling PBGetCatInfo with a CInfoPBRec stuffed with
ioVRefNum:=aWDPBRec.ioWDVRefNum;	{default vol}
ioDrDirID:=aDirID;			{from apple SFGetFile}
ioFDirIndex:= -1;			{gives info about dir specified}

But the vRefNum I got after the call was always 2, independent of which
folder was chosen.  By the way the folder name is being returned correctly
in ioNamePtr, so I think the call is working to some degree.

Any help would be appreciated.

------------------------------------------------------------------------------
|    Dan Boerner		Master's Student @ Oregon State Universtity  |
|				boerned@mist.CS.ORST.EDU		     |
------------------------------------------------------------------------------