PBCreateFileIDRefSync
PBCreateFileIDRef Establish a file ID reference for a file
#include <Files.h> File Manager
HParmBlkPtr pb ; pointer to a file ID parameter block
Boolean async ; 0=await completion; 1=immediate return
returns Error Code; 0=no error
Use the PBCreateFileIDRef function to establish a file ID reference for a
file.
pb is a pointer to a FIDParam structure.The relevant fields are as
follows:
Out-In Name Type Size Offset Description
Æ ioCompletion ProcPtr 4 12 pointer to completion routine
¨ ioResult short 2 16 result code
Æ ioNamePtr long 4 18 pointer to first filename
Æ ioVRefNum short 2 22 volume specification (volume reference number,
working directory reference number, drive
number, or 0 for default volume)
Æ ioSrcDirID long 4 48 first parent directory ID
۬ ioFileID long 4 54 file ID
async is a Boolean value. Use FALSE for normal (synchronous) operation
or TRUE to enqueue the request and resume control immediately. See
Async I/O.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
nsvErr (-35) Volume not found
ioErr (-36) I/O error
fnfErr (-43) File not found
wPrErr (-44) Hardware volume lock
vLckdErr (-46) Software volume lock
volOfflinErr (-53) Volume is off line
extFSErr (-58) External file system
wrgVolTypeErr (-123) Not an HFS volume
fidExists (-1301) File ID already exists
notAFileErr (-1302) Specified file is a directory

Notes: Given a volume reference number, filename, and parent directory ID,
PBCreateFileIDRef creates a record to hold the name and parent
directory ID of the specified file. PBCreateFileIDRef places the file ID in
the ioFileID field. If a file ID reference already exists for the file,
PBCreateFileIDRef supplies the file ID but returns fidExists.