Fortran · File status code

IOSTAT 20 — REWIND Error

What does IOSTAT 20 — REWIND Error mean in Fortran?

Occurs when a REWIND statement is issued on a unit that is not connected for sequential (or APPEND) access — for example a direct-access file, or a device that doesn't support repositioning. The runtime detects the mismatch between the requested operation and how the file was actually opened.

IOSTAT 20 — REWIND ErrorIntel Fortran

Condition

Occurs when a REWIND statement is issued on a unit that is not connected for sequential (or APPEND) access — for example a direct-access file, or a device that doesn't support repositioning. The runtime detects the mismatch between the requested operation and how the file was actually opened.

Fix

Confirm the OPEN statement used ACCESS='SEQUENTIAL' (the default) for any unit you plan to REWIND, and avoid rewinding units connected to terminals, pipes, or direct-access files.

Pending source verification. Not yet checked against official documentation.

Related file status code