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 File Access Routines / Manipulating the File Mark


PBGetFPos

You can use the PBGetFPos function to determine the current position of the file mark before reading from or writing to an open file.

FUNCTION PBGetFPos (paramBlock: ParmBlkPtr; async: Boolean): 
                     OSErr;
paramBlock
A pointer to a basic File Manager 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.
-->ioRefNum IntegerA file reference number.
<--ioReqCount LongIntOn output, set to 0.
<--ioActCountLongIntOn output, set to 0.
<--ioPosModeIntegerOn output, set to 0.
<--ioPosOffsetLongIntThe current position of the mark.

DESCRIPTION
The PBGetFPos function returns, in the ioPosOffset field, the mark of the specified file. The value returned in ioPosOffset is zero-based. Thus, a call to PBGetFPos returns 0 if you call it when the file mark is positioned at the beginning of the file.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro for PBGetFPos is _GetFPos.

RESULT CODES
noErr0No error
ioErr-36I/O error
fnOpnErr-38File not open
rfNumErr-51Bad reference number
gfpErr-52Error during PBGetFPos

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996