FORTRAN 77 Language Reference

Description

You can determine such things about a file as whether it exists, is opened, or is connected for sequential I/O. That is, files have such attributes as name, existence (or nonexistence), and the ability to be connected in certain ways (FORMATTED, UNFORMATTED, SEQUENTIAL, or DIRECT).

Inquire either by unit or by file, but not by both in the same statement.

In this system environment, the only way to discover what permissions you have for a file is to use the ACCESS(3F) function. The INQUIRE statement does not determine permissions.

The following table summarizes the INQUIRE specifiers:

Table 4-1 INQUIRE Specifiers Summary

Form: SPECIFIER = Variable 

SPECIFIER 

Value of Variable  

Data Type of Variable 

ACCESS

'DIRECT' 'SEQUENTIAL'

CHARACTER

BLANK

'NULL'

'ZERO'

CHARACTER

DIRECT *

'YES' 'NO' 'UNKNOWN'

CHARACTER

ERR

Statement number  

INTEGER

EXIST

.TRUE.

.FALSE.

LOGICAL

FORM

'FORMATTED' 'UNFORMATTED'

CHARACTER

FORMATTED *

'YES' 'NO' 'UNKNOWN'

CHARACTER

IOSTAT

Error number 

INTEGER

NAME

Name of the file 

CHARACTER

NAMED

.TRUE.

.FALSE.

LOGICAL

NEXTREC

Next record number 

INTEGER

NUMBER *

Unit number 

INTEGER

OPENED

.TRUE.

.FALSE.

LOGICAL

RECL

Record length 

INTEGER

SEQUENTIAL *

'YES' 'NO' 'UNKNOWN'

CHARACTER

UNFORMATTED *

'YES' 'NO' 'UNKNOWN'

CHARACTER

* indicates non-standard for inquire-by-unit, but accepted by f77. indicates non-standard for inquire-by-file, but accepted by f77.

Also:

INQUIRE Specifier Keywords

The following provides a detailed list of the INQUIRE specifier keywords:

ACCESS=acc

BLANK=blnk

DIRECT=dir

ERR=s

EXIST=ex

FILE=fn

FORM=fm

FORMATTED=fmt

IOSTAT=ios

NAME=fn

NAMED=nmd

NEXTREC=nr

NUMBER=num

OPENED=od

RECL=rcl

SEQUENTIAL=seq

UNFORMATTED=unf

UNIT=u