This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/29578] inquire(...) returns formatted=="YES" for unreadable and unformatted files



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2006-10-27 04:01 -------
If I understand correctly, the inquire FORMATTED= specifier does not have
anything to do with whether the file is opened for formatted or unformatted
I/O.  It is simply asking, is the file, if it exists, suitable for accessing as
formatted.

If the file resided on a tape drive, it may not be suitable for formatted I/O
because sometimes you have to seek backwards which you can't do with tape.

To inquire whether a file has been opened for formatted or unformatted I/O you
use the FORM= specifier.

So with your test case in comment 1 I am getting the correct results.

Also, when I change the test case to use FORM= instead, I get the correct
results. FORMATTED for the first part, UNFORMATTED for the second part and
UNDEFINED for all those inquires after the connection to the file has been
closed.

See F95 Standard section 9.6.1.10 and 9.6.1.11.

So I think this is NOT-A-BUG. 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29578


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]