iostat

Tobias Burnus burnus@net-b.de
Wed Aug 23 19:26:00 GMT 2006


Hello,

Steve Kargl wrote:
> If we do this (and I'm not necessarily opposed to better error
> messages), then I think we should add new (nonstandard) intrinsic
> procedure, say, iostat_to_msg().  This would be much easier to
> document, and avoids having to list errno values in gfortran.texi,
> and does require gfortran user to gravel through C code/headers.

How about just having the normal ERRNO numbers as iostat? (I thought
this was already the case; as it is not, I'm really in favour to change
it to returning the ERRNO.)

However, I don't see any advantage of adding another compiler specific
intrinsic subroutine.

Reasoning:
- The number you get for free. Any F77 compiler support iostat,
  which you can then print out:
  if(ios /= 0) then
     print *, 'Could not open file (error ',iostat,')'
  end
  Thus you can remain portable and still get some debug information
  if something goes wrong.

- But, if you want to use iostat_to_msg, your program is no longer
  portable. Well, in this case you could use iomsg right away
  as this is already supported by a couple existing Fortran 95+
  compilers, including gfortran 4.1.x and 4.2.x.

Or do I miss something and there is really a need for another intrinsic
subroutine?

Tobias



More information about the Fortran mailing list