Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)
Guardian Native C Library Calls (f) ftell(3)
NAME
ftell - Reports the position the file pointer of a stream
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <stdio.h>
long int ftell(
FILE ∗∗stream);
PARAMETERS
stream Specifies the I/O stream.
DESCRIPTION
The ftell( ) function obtains the current value of the file position indicator for the specified
stream.
Information About Guardian EDIT Files
If called from a native process, the ftell() function can operate on Guardian EDIT files (type 101
files). The behavior of this function differs according to whether the file is opened with a Guar-
dian connection or with an OSS connection.
To operate on a Guardian EDIT file using a Guardian connection to that file, a stream must be
opened by calling:
• fopen_guardian(), freopen_guardian(), or a similar function from any process.
• fopen( ), freopen(), or a similar function from a process executing in the Guardian
environment.
When the stream references a Guardian EDIT file using a Guardian connection, the ftell() func-
tion obtains a file position value as if an equivalent call were being made to the edftell( ) func-
tion.
To operate on a Guardian EDIT file using an OSS connection, a stream must be opened by cal-
ling:
• fopen_oss(), freopen_oss(), or a similar function from any process.
• fopen( ), freopen(), or a similar function from a process executing in the OSS environ-
ment.
When the stream references a Guardian EDIT file using an OSS connection, calls to the ftell()
function are implemented using the lseek() function. Refer to the lseek(2) reference page for
information about the lseek() function.
RETURN VALUES
Upon successful completion, the ftell() function returns the offset of the current byte relative to
the beginning of the file associated with the named stream. Otherwise, a value of -1 is returned,
and errno is set to indicate the error.
527192-005 Hewlett-Packard Company 2−77