Fortran · File status code
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.
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.
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.