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: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Mar 2007 00:45:28 -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 #4 from jvdelisle at gcc dot gnu dot org 2007-03-31 01:45 -------
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
--
jvdelisle at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |VERIFIED
Summary|When the last record written|Last record truncated for
|to a direct access file is |read after short write,
|shorter than the record |direct access file
|length of the file, gfortran|
|truncates the record |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31366