Your Browser is not longer supported
Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...
{{viewport.spaceProperty.prod}}
fgetpos, fgetpos64 - Determine current position of the read/write pointer
&pagelevel(4)&pagelevel
Definition | #include <stdio.h> int fgetpos(FILE *fp, fpos_t *pos); int fgetpos64 (FILE *fp, fpos64_t *pos); fgetpos and fgetpos64 return the current position of the read/write pointer for the file with the file pointer fp in the area to which pos points. The information stored in pos can be used to position the file with the fsetpos or fsetpos64 function, insofar as *pos is passed to it as an argument. There is no functional difference between fgetpos and fgetpos64 , except that
fgetpos64 uses the fpos64_t data type. To process files > 2 GB, proceed as follows: If the _FILE_OFFSET_BITS 64 define (see "Support for DMS and UFS files > 2 GB") is set, call fgetpos . fgetpos64 is then used implicitly with the appropriate parameters. Otherwise, you have to call fgetpos64 . |
Return val. | 0 != 0 | On successful execution of fgetpos or fgetpos64 . In the event of an error. In addition, errno is set to EBADF. |
Notes | fgetpos /fgetpos64 can be used on binary files (SAM in binary mode, PAM, INCORE) and text files (SAM in text mode, ISAM).
fgetpos /fgetpos64 cannot be used on system files (SYSDTA, SYSLST, SYSOUT). For ISAM files the function pair fgetpos /fsetpos or fgetpos64 /fsetpos64 is considerably more efficient than the comparable function pair ftell /fseek or ftell64 /fseek64 . |
Record I/O | fgetpos and fgetpos64 return the position after the last record to be read, written or deleted or the position reached by an immediately preceding positioning operation. For ISAM files with key duplication, fgetpos and fgetpos64 always return the position after the last record of a group with identical keys if one of these records has previously been read, written or deleted. |
See also | fsetpos, fsetpos64, fseek, fseek64, ftell, ftell64 |