is_iostat_end
tests whether an variable has the value of the I/O status “end of file”. The function is equivalent to comparing the variable with the iostat_end
parameter of the intrinsic module iso_fortran_env.
Fortran 2003 and later
result = is_iostat_end(i)
i
- Shall be of the type integer
.Returns a logical
of the default kind, which .true.
if i
has the value which indicates an end of file condition for IOSTAT=
specifiers, and is .false.
otherwise.
program iostat
implicit none
integer :: stat, i
open(88, file='test.dat')
read(88, *, iostat=stat) i
if(is_iostat_end(stat)) stop 'end of file'
end program