HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
INQUIRE
Chapter 10382
returns the following values, indicating whether or not the file is connected
for formatted I/O:
WRITE=
character-variable
returns the following values, indicating whether or not writing is an allowed
action for the file:
Description
The INQUIRE statement returns selected properties of a specified file or unit number. (It is
illegal to include both the UNIT= specifier and the FILE= specifier in the same INQUIRE
statement.) Inquiring by unit number should be used on connected files; inquiring by filename
is typically used on unconnected files.
In addition, the INQUIRE statement can also be used to determine the record length of a new
or existing file. That is, you can use INQUIRE to obtain the record length before creating the
file and then use the return value as the argument to the RECL= specifier in an OPEN
statement.
Examples
The following examples illustrate different uses of the INQUIRE statement.
Inquiry by file
Table 10-26
'YES' File is connected for
unformatted I/O.
'NO' File is not connected for
unformatted I/O.
'UNKNOWN' It cannot be determined
whether or not file is connected
for unformatted I/O.
Table 10-27
'YES' Writing is allowed for file.
'NO' Writing is not allowed for file.
'UNKNOWN' It cannot be determined
whether or not writing is
allowed for file.