161. Use REWIND and BACKSPACE to change file position.#

topic: Input and Output

Note

This tip is a draft1.

REWIND (unit=u) positions the file at the beginning so it can be reread or rewritten. A WRITE deletes lines after the position. BACKSPACE moves the position back one line. It can be used to print an informative error message when a READ fails.



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.