Fortran · File status code
What does IOSTAT 31 — Mixed File Access Modes mean in Fortran?
Signaled when a program mixes incompatible access modes on the same unit — for instance issuing a formatted operation on a unit opened FORM='UNFORMATTED', or switching between sequential and direct-style operations without closing and reopening.
Signaled when a program mixes incompatible access modes on the same unit — for instance issuing a formatted operation on a unit opened FORM='UNFORMATTED', or switching between sequential and direct-style operations without closing and reopening.
Keep the FORM= and ACCESS= attributes from the OPEN statement consistent with every subsequent READ/WRITE on that unit, or close and reopen with the new attributes if the mode genuinely needs to change.