Dan Nagle writes:
> > It must be my week for missing the point. What's the different
> > between non-advancing formatted I/O and formatted stream I/O?
>
> The processor is allowed to insert control words with traditional
> Fortran IO. Stream IO would have no control words, just bits.
Fundamentally, non-advancing I/O is little different from advancing.
There is still a record structure (which generally implies
processor-inserted control stuff). After all, non-advancing is
something that applies to a single write statement - not a whole file.
All that non-advancing does for you is allow you to use multiple
statements to write a record instead of forcing a record boundary
after each write. Consequences of this include
1. I've seen implementations where there were size limits to how long
stream of data you could write non-advancing. By some not-too-odd
coincidence, these limits looked an awful lot like the record size
limits of the processor.
2. Data sometimes doesn't get flushed until you finish a record. I've
seen cases where, if you write an entite file without ever
terminating a record, you will never get any data on the file, even
after you close it. (I'm not sure whether this is strictly
standard conforming - don't feel like studying the relevant
portions of the standard at the moment).
3. Even with non-advancing I/O, you can have record boundaries created
by explicit "/" edit descriptors or by format reversion. Its only
the record boundary at the end of the read or write statement that
is affected by non-advancing.
(What to do about things like "/" edit descriptors is one of the
complications of formatted stream i/o that drives me to say I don't
have time to work that all out. Do you disallow "/" and format
reversion, say they can be there but have no effect, or try to define
them to do something? And if they do something, there is lots of
"fun" in sorting out the interaction between the processor-inserted
control characters those that the user might have explicitly
written).
--
Richard Maine
[log in to unmask]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|