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.
| --> | ioCompletion | ProcPtr | A pointer to a completion routine. |
| <-- | ioResult | OSErr | The result code of the function. |
| --> | ioRefNum | Integer | A file reference number. |
| <-- | ioReqCount | LongInt | On output, set to 0. |
| <-- | ioActCount | LongInt | On output, set to 0. |
| <-- | ioPosMode | Integer | On output, set to 0. |
| <-- | ioPosOffset | LongInt | The 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
| noErr | 0 | No error |
| ioErr | -36 | I/O error |
| fnOpnErr | -38 | File not open |
| rfNumErr | -51 | Bad reference number |
| gfpErr | -52 | Error during PBGetFPos |