This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29578] inquire(...) returns formatted=="YES" for unreadable and unformatted files
- From: "tobias dot burnus at physik dot fu-berlin dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Oct 2006 13:31:09 -0000
- Subject: [Bug fortran/29578] inquire(...) returns formatted=="YES" for unreadable and unformatted files
- References: <bug-29578-1719@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from tobias dot burnus at physik dot fu-berlin dot de 2006-10-24 13:31 -------
I'm actually not any more sure what is meant by "formatted" in
inquire(). The Fortran 2003 standard says:
"The scalar-default-char-variable in the FORMATTED= specifier is
assigned the value YES if FORMATTED is included in the set of allowed
forms for the file, NO if FORMATTED is not included in the set of
allowed forms for the file, and UNKNOWN if the processor is unable to
determine whether or not FORMATTED is included in the set of allowed
forms for the file."
What makes an UNFORMATTED file allowed for FORMATTED access?
Currently, the check is (libgfortran/io/unix.c; inquire_formatted):
Empty string/file does not exist: "UNKNOWN"
Directory: "NO"
Regular file, block device, character device, pipe: "YES".
Is "YES" what one would expect for a binary file? Ifort writes "NO" if
one has open()ed an unformatted file [and simply "UNKNOWN" otherwise].
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29578