Fortran · File status code

IOSTAT 47 — Write to READONLY File

What does IOSTAT 47 — Write to READONLY File mean in Fortran?

A WRITE (or REWRITE/DELETE) was attempted on a unit opened with ACTION='READ' or the READONLY specifier, so the runtime refuses the operation regardless of the underlying file system permissions.

IOSTAT 47 — Write to READONLY FileIntel Fortran

Condition

A WRITE (or REWRITE/DELETE) was attempted on a unit opened with ACTION='READ' or the READONLY specifier, so the runtime refuses the operation regardless of the underlying file system permissions.

Fix

Change ACTION= to 'READWRITE' (or drop READONLY) on the OPEN statement if the unit genuinely needs to be written, or fix the logic issuing the unwanted write.

Pending source verification. Not yet checked against official documentation.

Related file status code