# 10.5 INQUIRE Statement

The INQUIRE statement requests information about specified properties of a file or of a logical unit on which a file might be opened. It takes one of the following forms:

### Inquiring by File

    INQUIRE (FILE=fi [,DEFAULTFILE=dfi . . .], flist)

### Inquiring by Unit

    INQUIRE ([UNIT=]u, flist)

fi
  Is a character expression, numeric scalar memory reference, or numeric array name reference, whose value specifies the name of the file to be inquired about.
dfi
  Is a character expression specifying a default file pathname string.
flist
  Is a list of property specifiers in which any one specifier appears only once. The specifiers are described in the following sections.
u
  Is the number of the logical unit to be inquired about. The unit does not have to exist, nor does it need to be connected to a file. If the unit is connected to a file, the inquiry encompasses both the connection and the file.

Rules and Behavior

FILE=fi and UNIT=u can appear anywhere in the property-specifier list; however, if the UNIT keyword is omitted, the unit specifier u must be the first parameter in the list.

An INQUIRE statement may be executed before, during, or after the connection of a file to a unit. The values assigned by the statement are those that are current when the INQUIRE statement executes.

To get file characteristics, specify the INQUIRE statement after opening the file.

When inquiring by file, you can specify DEFAULTFILE=dfi in addition to, or in place of, FILE=fi. If a file is opened with both FILE and DEFAULTFILE keywords specified in the OPEN statement, then you can inquire about this file by specifying both the FILE and DEFAULTFILE keywords in the INQUIRE statement. On Tru64 UNIX systems, the file names of fi and dfi can start with a tilde (~).

Previous Page Next Page Table of Contents