Re: reading back a partially-written record on direct access
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Sat, 31 Mar 2007 12:56:55 -0700
glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx> wrote:
Richard Maine wrote:
I think that the read is valid,
but the variable "i" becomes undefined. But I'll admit there might be
room to question that. I'd have to research a bit further to be
completely sure. There might be a requirement somewhere that the record
contain an integer to correspond with "i". If so, the rest of the record
being undefined would violate that. I'm too lazy to look further right
now, but that's at least a hint of the kind of thing I'd look for.
Regarding undefined values, comp.lang.c discussions sometimes
indicate that there could be invalid values to some variables,
such that even assigning them to a variable could be illegal.
Yes. I was thinking along those lines - bit patterns that might not be
allowed in some types. Apparently the standard doesn't allow for such a
case. Note that TRANSFER has simillar issues.
Also relating to unformatted direct access files in 9.5.3.4.1:[cases that aren't this one]
"On input, if the file storage units transferred do not contain
a value with the same type and type parameters as the input list
entity, then the resulting value of the entity is
processor-dependent except in the following cases:
Thanks for doing the research. That's exactly the critical bit. So it
says that the read is valid, but the result is processor dependent.
This one says processor dependent, not undefined. Consider:
Yes. That minorly surprises me. I might have thought undefined. But in
either case, the read is valid; the only distinction is in whether or
not it is subsequently valid to reference the variable. The original
code in question did not reference the variable, so I conclude it was
standard-conforming (except for the inquite thing).
I suppose that by saying the result is processor-dependent instead of
undefined, the standard is more-or-less condoning unformatted I/O as a
way of doing the equivalent of a TRANSFER, which also gives a
processor-dependent result. The I/O wording doesn't say the same things
as TRANSFER about the bits being identical, it's true.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- References:
- reading back a partially-written record on direct access
- From: Thomas König
- Re: reading back a partially-written record on direct access
- From: glen herrmannsfeldt
- Re: reading back a partially-written record on direct access
- From: Richard Maine
- Re: reading back a partially-written record on direct access
- From: glen herrmannsfeldt
- reading back a partially-written record on direct access
- Prev by Date: Re: Starting to doubt fortran
- Next by Date: Re: reading back a partially-written record on direct access
- Previous by thread: Re: reading back a partially-written record on direct access
- Next by thread: Importing from Microsoft Access in Fortran
- Index(es):
Relevant Pages
|