Guardian C Library Calls Reference Manual

ftell
3-68 128833Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
ftell
The ftell function retrieves the file-position indicator of a byte-addressable file opened
for ANSI I/O. This file-position indicator corresponds to the current byte offset from the
beginning of the file.
stream
denotes a file opened for ANSI I/O.
Return Value
is the file-position indicator, expressed as a long value.
Example
In this example, the ftell function returns the file-position indicator of $a.b.c:
#include <stdioh>
FILE *fp;
long pos;
fp = fopen("$a.b.c", "r");
/* ... */
pos = ftell(fp);
#include <stdioh>
long ftell(FILE *stream);