reading back a partially-written record on direct access
- From: "Thomas König" <tkoenig@xxxxxxxxxxxxx>
- Date: 31 Mar 2007 00:20:27 -0700
Is the following program standard-conforming?
PROGRAM test
IMPLICIT NONE
CHARACTER*8 as_written, as_read
INTEGER irec
INTEGER i
as_written = "12345678"
inquire (iolength=irec) as_written, i
OPEN (76, FILE="test.txt", ACCESS="DIRECT", STATUS="NEW",
& RECL=irec)
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
I don't think it is, because it reads something that wasn't written
(the variable i). On the other hand, i isn't used, so it may be OK.
.
- Follow-Ups:
- Re: reading back a partially-written record on direct access
- From: glen herrmannsfeldt
- Re: reading back a partially-written record on direct access
- Prev by Date: Re: Starting to doubt fortran
- Next by Date: Re: variable content lost
- Previous by thread: variable content lost
- Next by thread: Re: reading back a partially-written record on direct access
- Index(es):
Relevant Pages
|