This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/18982] New: open(status="new") does not generate an error if the file exists
- From: "Thomas dot Koenig at online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Dec 2004 13:30:06 -0000
- Subject: [Bug libfortran/18982] New: open(status="new") does not generate an error if the file exists
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat open.f90
nout = 10
open(nout, file="foo.dat", status="new")
close(nout)
open(nout, file="foo.dat", status="new",err=100) ! This should fail
write(nout,*) "Hello" ! and not this.
100 continue
end
$ rm -f foo.dat
$ gfortran open.f90
$ ./a.out
At line 5 of file open.f90
Fortran runtime error: Cannot write to file opened for READ
--
Summary: open(status="new") does not generate an error if the
file exists
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libfortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Thomas dot Koenig at online dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18982