GetFPos
You can use the GetFPos function to determine the current position of the mark before reading from or writing to an open file.
FUNCTION GetFPos (refNum: Integer; VAR filePos: LongInt): OSErr;
refNum
- The file reference number of an open file.
filePos
- On output, the current position of the mark.
DESCRIPTION
The GetFPos function returns, in the filePos parameter, the current position of the file mark for the specified open file. The position value is zero-based; that is, the value of filePos is 0 if the file mark is positioned at the beginning of the file.
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 GetFPos |