9.108. FSEEK

9.108 FSEEK — Low level file positioning subroutine

Description:
Moves UNIT to the specified OFFSET. If WHENCE is set to 0, the OFFSET is taken as an absolute value SEEK_SET, if set to 1, OFFSET is taken to be relative to the current position SEEK_CUR, and if set to 2 relative to the end of the file SEEK_END. On error, STATUS is set to a nonzero value. If STATUS the seek fails silently.

This intrinsic routine is not fully backwards compatible with g77. In g77, the FSEEK takes a statement label instead of a STATUS variable. If FSEEK is used in old code, change

CALL FSEEK(UNIT, OFFSET, WHENCE, *label)

to

INTEGER :: status
CALL FSEEK(UNIT, OFFSET, WHENCE, status)
IF (status /= 0) GOTO label
登录查看完整内容