2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. index:: FTELL, file operation, position
10 FTELL --- Current stream position
11 *********************************
13 .. function:: FTELL(UNIT)
15 Retrieves the current position within an open file.
18 Shall of type ``INTEGER``.
21 Shall of type ``INTEGER``.
24 In either syntax, :samp:`{OFFSET}` is set to the current offset of unit
25 number :samp:`{UNIT}`, or to -1 if the unit is not currently open.
34 .. code-block:: fortran
36 CALL FTELL(UNIT, OFFSET)
40 .. code-block:: fortran
44 OPEN(10, FILE="temp.dat")