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
Low-Level HFS Routines / Accessing Information About Files and Directories


PBHGetFInfo

You can use the PBHGetFInfo function to obtain information about a file.

FUNCTION PBHGetFInfo (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.
<->ioNamePtr StringPtrA pointer to a pathname.
-->ioVRefNumIntegerA volume specification.
<--ioFRefNumIntegerA file reference number.
-->ioFDirIndexIntegerAn index.
<--ioFlAttribSignedByteThe file attributes.
<--ioFlFndrInfoFInfoInformation used by the Finder.
<->ioDirIDLongIntOn input, a directory ID; on output, a file ID.
<--ioFlStBlk IntegerThe first allocation block of the data fork.
<--ioFlLgLenLongIntThe logical end-of-file of the data fork.
<--ioFlPyLenLongIntThe physical end-of-file of the data fork.
<--ioFlRStBlkIntegerThe first allocation block of the resource fork.
<--ioFlRLgLenLongIntThe logical end-of-file of the resource fork.
<--ioFlRPyLenLongIntThe physical end-of-file of the resource fork.
<--ioFlCrDatLongIntThe date and time of creation.
<--ioFlMdDatLongIntThe date and time of last modification.

DESCRIPTION
If the value of ioFDirIndex is positive, the PBHGetFInfo function returns information about the file whose directory index is ioFDirIndex on the volume specified by ioVRefNum in the directory specified by ioDirID. You should call PBHGetFInfo just before PBHSetFInfo, so that the current information is present
in the parameter block.

Note
If a working directory reference number is specified in ioVRefNum, the File Manager returns information about the file whose directory index is ioFDirIndex in the specified directory.
If the value of ioFDirIndex is negative or 0, the PBHGetFInfo function returns information about the file having the name pointed to by ioNamePtr on the volume specified by ioVRefNum. If the file is open, the reference number of the first access path found is returned in ioFRefNum, and the name of the file is returned in ioNamePtr (unless ioNamePtr is NIL).

ASSEMBLY-LANGUAGE INFORMATION
The trap macro for PBHGetFInfo is _HGetFileInfo.

RESULT CODES
noErr0No error
nsvErr-35No such volume
ioErr-36I/O error
bdNamErr-37Bad filename
fnfErr-43File not found
paramErr-50No default volume
dirNFErr-120Directory not found or incomplete pathname
afpAccessDenied-5000User does not have the correct access
afpObjectTypeErr-5025Directory not found or incomplete pathname

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996