155. Use INQUIRE to get unit and file properties.#

topic: Input and Output

Note

This tip is a draft1.

The INQUIRE statement can tell if a unit has been opened, if a file exists, a file’s size, whether it is open for reading or writing, formatted or not, its form of access, and other properties. Common uses of INQUIRE can be wrapped as functions as shown.



1

From the perspective of FortranTip Browser, “draft” means that it hasn’t been edited for formatting, hasn’t had corresponding Fortran programs added, the text content hasn’t been enhanced, etc. Draft texts are extracted from the corresponding Tweet using the Twitter API.