Important: The information in this document is obsolete and should not be used for new development.
PBMakeFSSpec
You can use the low-levelPBMakeFSSpecfunction to create anFSSpecrecord for a file or directory.
FUNCTION PBMakeFSSpec (paramBlock: HParmBlkPtr; async: Boolean): OSErr;
paramBlock- A pointer to a basic HFS parameter block.
async- A Boolean value that specifies asynchronous (
TRUE) or synchronous (FALSE) execution.
--> ioCompletionProcPtrA pointer to a completion routine. <-- ioResultOSErrThe result code of the function. --> ioNamePtrStringPtrA pointer to a file or directory name. --> ioVRefNumIntegerA volume specification. --> ioMiscLongIntA pointer to an FSSpecrecord.--> ioDirIDLongIntA parent directory ID. DESCRIPTION
Given a complete specification for a file or directory, thePBMakeFSSpecfunction fills in anFSSpecrecord that identifies the file or directory. (See Table 2-10 on page 2-35 for a detailed description of valid file specifications.)If the specified volume is mounted and the specified parent directory exists, but the target file or directory doesn't exist in that location,
PBMakeFSSpecfills in the record and returnsfnfErrinstead ofnoErr. The record is valid, but it describes a target that doesn't exist. You can use the record for another operation, such as creating a file.In addition to the result codes that follow,
PBMakeFSSpeccan return a number of different File Manager error codes. WhenPBMakeFSSpecreturns any result other
thannoErrorfnfErr, all fields of the resultingFSSpecrecord are set to 0.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector forPBMakeFSSpecare
Trap macro Selector _HFSDispatch $001B RESULT CODES
noErr 0 No error nsvErr -35 Volume doesn't exist fnfErr -43 File or directory does not exist ( FSSpecis still valid)