Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Files /
Chapter 2 - File Manager / File Manager Reference
File System Specification Routines / Creating File System Specifications


PBMakeFSSpec

You can use the low-level PBMakeFSSpec function to create an FSSpec 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.
--> 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 FSSpec record.
--> ioDirIDLongIntA parent directory ID.

DESCRIPTION
Given a complete specification for a file or directory, the PBMakeFSSpec function fills in an FSSpec 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 returns fnfErr instead of noErr. 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. When PBMakeFSSpec returns any result other
than noErr or fnfErr, all fields of the resulting FSSpec record are set to 0.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for PBMakeFSSpec are
Trap macroSelector
_HFSDispatch$001B

RESULT CODES
noErr0No error
nsvErr-35Volume doesn't exist
fnfErr-43File or directory does not exist (FSSpec is still valid)

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996