fgetpos
- Updated2023-02-21
- 1 minute(s) read
int fgetpos (FILE *stream, fpos_t *currentFilePosition);
Purpose
Obtains the current value of the file position indicator for the specified stream. The value obtained is stored in a struct fpos_t. This structure contains unspecified information that can be used by fsetpos to reposition the stream to its position at the time of the call to fgetpos.
![]() |
Note This function is similar to ftell but is more useful for files that contain more than 2 billion bytes. |
Parameters
Input | ||
Name | Type | Description |
stream | FILE * | Contains a pointer to the stream from which the file position indicator is obtained. |
Output | ||
Name | Type | Description |
currentFilePosition | fpos_t | Contains a pointer to the struct holding the file position indicator value. This struct can be used in the fsetpos function to reposition a stream to its position at the time of the call to fgetpos. |
Return Value
Name | Type | Description |
status | int | Contains the resulting status of the function. If successful, fgetpos returns 0. If an error occurs, fgetpos returns a nonzero value and sets errno to a nonzero value. |
Additional Information
Library: ANSI C Library
Include file: ansi_c.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later