This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31366] Last record truncated for read after short write, direct access file
- From: "tkoenig at alice-dsl dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Mar 2007 07:11:42 -0000
- Subject: [Bug fortran/31366] Last record truncated for read after short write, direct access file
- References: <bug-31366-14284@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from tkoenig at alice-dsl dot net 2007-03-31 08:11 -------
Subject: Re: Last record truncated for read after short
write, direct access file
On Sat, 2007-03-31 at 00:45 +0000, jvdelisle at gcc dot gnu dot org
wrote:
> Michael sent me this excellent test case illustrating the problem.
>
> PROGRAM test
> CHARACTER(LEN=8) :: as_written, as_read
> as_written = "12345678"
> OPEN (76, FILE="test.txt", ACCESS="DIRECT", STATUS="NEW",
> RECL=12)
> WRITE(76, REC=1) as_written
> READ(76, REC=1) as_read, i
> PRINT *, "as_written = ", as_written, " as_read = ", as_read
> CLOSE(76)
> END PROGRAM test
Hi Jerry,
this reads a variable that we haven't written. I am
not convinced that this is standard-conforming.
I'll ask on c.l.f.
Thomas
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31366