Important: The information in this document is obsolete and should not be used for new development.
PBMakeFSSpec
You can use the low-levelPBMakeFSSpec
function to create anFSSpec
record 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.
--> ioCompletion
ProcPtr
A pointer to a completion routine. <-- ioResult
OSErr
The result code of the function. --> ioNamePtr
StringPtr
A pointer to a file or directory name. --> ioVRefNum
Integer
A volume specification. --> ioMisc
LongInt
A pointer to an FSSpec
record.--> ioDirID
LongInt
A parent directory ID. DESCRIPTION
Given a complete specification for a file or directory, thePBMakeFSSpec
function fills in anFSSpec
record 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,
PBMakeFSSpec
fills in the record and returnsfnfErr
instead 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,
PBMakeFSSpec
can return a number of different File Manager error codes. WhenPBMakeFSSpec
returns any result other
thannoErr
orfnfErr
, all fields of the resultingFSSpec
record are set to 0.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector forPBMakeFSSpec
are
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 ( FSSpec
is still valid)