Intel® Fortran Compiler 18.0 Developer Guide and Reference

OPEN: ACTION Specifier

The ACTION specifier indicates the allowed I/O operations for the file connection. It takes the following form:

ACTION = act

act

Is a scalar default character expression that evaluates to one of the following values:

'READ'

Indicates that only READ statements can refer to this connection.

'WRITE'

Indicates that only WRITE, DELETE, and ENDFILE statements can refer to this connection.

'READWRITE'

Indicates that READ, WRITE, DELETE, and ENDFILE statements can refer to this connection.

The default is 'READWRITE'.

However, if compiler option fpscomp general is specified on the command line and action is omitted, the system first attempts to open the file with 'READWRITE'. If this fails, the system tries to open the file again, first using 'READ', then using 'WRITE'.

Note that in this case, omitting action is not the same as specifying ACTION='READWRITE'. If you specify ACTION='READWRITE' and the file cannot be opened for both read and write access, the attempt to open the file fails. You can use the INQUIRE statement to determine the actual access mode selected.

See Also