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.
--> ioCompletion
ProcPtr
A pointer to a completion routine. <-- ioResult
OSErr
The result code of the function. <-> ioNamePtr
StringPtr
A pointer to a pathname. --> ioVRefNum
Integer
A volume specification. <-> ioRefNum
Integer
The file reference number. --> ioFCBIndx
Integer
An index. <-- ioFCBFlNm
LongInt
The file ID. <-- ioFCBFlags
Integer
File status flags. <-- ioFCBStBlk
Integer
The first allocation block of the file. <-- ioFCBEOF
LongInt
The logical end-of-file. <-- ioFCBPLen
LongInt
The physical end-of-file. <-- ioFCBCrPs
LongInt
The position of the file mark. <-- ioFCBVRefNum
Integer
The volume reference number. <-- ioFCBClpSiz
LongInt
The file clump size. <-- ioFCBParID
LongInt
The parent directory ID. DESCRIPTION
ThePBGetFCBInfo
function returns information about the specified open file. If the value ofioFCBIndx
is positive, the File Manager returns information about the file whose index in the FCB buffer isioFCBIndx
and 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 ofioVRefNum
is 0, all open files are indexed; otherwise, only open files on the specified volume are indexed.If the value of
ioFCBIndx
is 0, the File Manager returns information about the file whose file reference number is specified by theioRefNum
field. If the value ofioFCBIndx
is positive, theioRefNum
field is ignored on input and contains the file reference number on output.If PBGetFCBInfo executes successfully, the
ioNamePtr
field contains the name of the specified open file. You should pass a pointer to aStr31
value if you want that name returned. If you passNIL
in theioNamePtr
field, no filename is returned.The
ioFCBFlags
field 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 forPBGetFCBInfo
are
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