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.
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.pic.twitter.com/4ksASPJnLS
— FortranTip (@fortrantip) March 16, 2022
- 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.