Important: The information in this document is obsolete and should not be used for new development.
PBGetFCBInfo
You can use PBGetFCBInfo to get information about an open file.
FUNCTION PBGetFCBInfo (paramBlock: FCBPBPtr; async: Boolean): OSErr;
paramBlock- A pointer to a file control block 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 pathname. --> ioVRefNumIntegerA volume specification. <-> ioRefNumIntegerThe file reference number. --> ioFCBIndxIntegerAn index. <-- ioFCBFlNmLongIntThe file ID. <-- ioFCBFlagsIntegerFile status flags. <-- ioFCBStBlkIntegerThe first allocation block of the file. <-- ioFCBEOFLongIntThe logical end-of-file. <-- ioFCBPLenLongIntThe physical end-of-file. <-- ioFCBCrPsLongIntThe position of the file mark. <-- ioFCBVRefNumIntegerThe volume reference number. <-- ioFCBClpSizLongIntThe file clump size. <-- ioFCBParIDLongIntThe parent directory ID. DESCRIPTION
ThePBGetFCBInfofunction returns information about the specified open file. If the value ofioFCBIndxis positive, the File Manager returns information about the file whose index in the FCB buffer isioFCBIndxand that is located on the volume specified byioVRefNum(which may contain a drive number, volume reference number, or working directory reference number). If the value ofioVRefNumis 0, all open files are indexed; otherwise, only open files on the specified volume are indexed.If the value of
ioFCBIndxis 0, the File Manager returns information about the file whose file reference number is specified by theioRefNumfield. If the value ofioFCBIndxis positive, theioRefNumfield is ignored on input and contains the file reference number on output.If PBGetFCBInfo executes successfully, the
ioNamePtrfield contains the name of the specified open file. You should pass a pointer to aStr31value if you want that name returned. If you passNILin theioNamePtrfield, no filename is returned.The
ioFCBFlagsfield returns status information about the specified open file. See
"File Control Block Parameter Blocks" beginning on page 2-107 for a description of
the meaning of the bits in this field.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector forPBGetFCBInfoare
Trap macro Selector _HFSDispatch $0008 RESULT CODES
noErr 0 No error nsvErr -35 Specified volume doesn't exist fnOpnErr -38 File not open rfNumErr -51 Reference number specifies nonexistent access path