is_iostat_end(3f) - [FORTRAN:INTRINSIC] Test for end-of-file value
function is_iostat_end(i)
logical :: is_iostat_end (i) integer,intent(in) :: i
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]].
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.
Sample program:
program demo_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 demo_iostat
[[Fortran 2003]] and later
[[Elemental function]]
is_iostat_end (3) | March 11, 2021 |