Fortran · File status code

IOSTAT 0 — Successful Completion

What does IOSTAT 0 — Successful Completion mean in Fortran?

The value IOSTAT= is set to when the READ, WRITE, OPEN, or CLOSE statement completed with no error, no end-of-file, and no end-of-record condition. It is the only value guaranteed by the standard to mean 'nothing went wrong' — every other value (positive or negative) signals some condition worth handling.

IOSTAT 0 — Successful CompletionIntel Fortran · gfortran

Condition

The value IOSTAT= is set to when the READ, WRITE, OPEN, or CLOSE statement completed with no error, no end-of-file, and no end-of-record condition. It is the only value guaranteed by the standard to mean 'nothing went wrong' — every other value (positive or negative) signals some condition worth handling.

Fix

Nothing to fix; use this as the baseline in IF (IOSTAT == 0) checks and treat any nonzero result as needing a branch into error or end-of-file handling.

Pending source verification. Not yet checked against official documentation.

Related file status code