Clicky

Fortran Wiki
is_iostat_eor

Description

is_iostat_eor tests whether an variable has the value of the I/O status “end of record”. The function is equivalent to comparing the variable with the iostat_eor parameter of the intrinsic module iso_fortran_env.

Standard

Fortran 2003 and later

Class

Elemental function

Syntax

result = is_iostat_eor(i)

Arguments

  • i - Shall be of the type integer.

Return value

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.

Example

program iostat
  implicit none
  integer :: stat, i(50)
  open(88, file='test.dat', form='unformatted')
  read(88, iostat=stat) i
  if(is_iostat_eor(stat)) stop 'end of record'
end program

category: intrinsics