FTELL — Current stream position

FTELL()

Retrieves the current position within an open file.

Parameters
  • OFFSET – Shall of type INTEGER.

  • UNIT – Shall of type INTEGER.

Returns

In either syntax, OFFSET is set to the current offset of unit number UNIT, or to -1 if the unit is not currently open.

Standard:

GNU extension

Class:

Subroutine, function

Syntax:

CALL FTELL(UNIT, OFFSET)
OFFSET = FTELL(UNIT)

Example:

PROGRAM test_ftell
  INTEGER :: i
  OPEN(10, FILE="temp.dat")
  CALL ftell(10,i)
  WRITE(*,*) i
END PROGRAM
See also:

FSEEK