Compaq Fortran for Tru64 UNIX Alpha Systems V5.4
fseek, ftell (3f)
repositions a file on a logical unit
Syntax
integer*4 fseek, ierrno, lunit, offset, from
external fseek
ierrno = fseek ( lunit, offset, from )
integer*4 ftell, posit, lunit
external ftell
posit = ftell ( lunit )
Description
The fseek function sets the position of the next input or output operation
on the lunit. The new position is at the distance offset (in bytes) from
the beginning of the file according to the position specified by from.
The ftell function returns the current position of the file associated with
the specified logical unit. The value is an offset (in bytes) from the
beginning of the file.
The lunit argument must refer to an open logical unit. The from argument
takes one of the following values:
0 Meaning 'the beginning of the file'
1 Meaning 'the current position'
2 Meaning 'the end of the file'
Return Values
The fseek function returns zero if it is successful, otherwise it returns a
system error code.
If the ftell function returns a negative value, it indicates an error and
is the negation of the system error code.
See Also
fseek(3s), perror(3f)