PBCreateFileIDRef
Use the PBCreateFileIDRef function to establish a file ID reference for a file.
FUNCTION PBCreateFileIDRef (paramBlock: HParmBlkPtr;
async: Boolean): OSErr;
- paramBlock
- A pointer to an
fidParam variant of the HFS parameter block.
async
- A Boolean value that specifies asynchronous (
TRUE) or synchronous (FALSE) execution.
| --> | ioCompletion | ProcPtr | A pointer to a completion routine. |
| <-- | ioResult | OSErr | The result code of the function. |
| --> | ioNamePtr | StringPtr | A pointer to a filename. |
| --> | ioVRefNum | Integer | A volume specification. |
| --> | ioSrcDirID | LongInt | The file's parent directory ID. |
| <-- | ioFileID | LongInt | A file ID. |
DESCRIPTION
Given a volume reference number, filename, and parent directory ID, the PBCreateFileIDRef function 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 the result code fidExists.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for PBCreateFileIDRef are
| Trap macro | Selector |
| _HFSDispatch | $0014 |
RESULT CODES
| 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 |
| paramErr | -50 | Function not supported by volume |
| volOfflinErr | -53 | Volume is offline |
| extFSErr | -58 | External file system |
| wrgVolTypErr | -123 | Not an HFS volume |
| fidExists | -1301 | File ID already exists |
| notAFileErr | -1302 | Specified file is a directory |
| afpAccessDenied | -5000 | User does not have the correct access |
| afpObjectTypeErr | -5025 | Specified file is a directory |
| afpIDExists | -5035 | File ID already exists |