ftell
- Updated2023-02-21
- 1 minute(s) read
ftell
long ftell (FILE *stream);
Purpose
Returns the current value of the file position indicator for the specified stream. For binary streams, the value is the number of characters from the beginning of the file. For a text stream, the value is not necessarily a meaningful measure, but can be used by fseek to restore the file position indicator to the current position.
![]() |
Note This function is similar to fgetpos; however, fgetpos is more useful for huge files (over 2 billion bytes). |
Parameters
Input | ||
Name | Type | Description |
stream | FILE * | Contains a pointer to the stream from which the file position indicator is returned. |
Return Value
Name | Type | Description |
currentFilePosition | long | Contains the resulting value of the current file position indicator for the specified stream. If the operation fails, ftell returns -1 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