Re: Question about READ statement
- From: Gordon Sande <g.sande@xxxxxxxxxxxxxxxx>
- Date: Sat, 12 Jul 2008 15:48:08 GMT
On 2008-07-12 12:31:29 -0300, nospam@xxxxxxxxxxxxx (Richard Maine) said:
Gordon Sande <g.sande@xxxxxxxxxxxxxxxx> wrote:
What has not been said is that Fortran's I/O model is record oriented...So if you think partial reading and backspacing are important then Fortran
has done it right and if you think byte streams are the future of modern
file systems then Fortran has done it wrong. The opposite assumptions lead
to opposite conclusions.
Of course, all of that was for Fortran 95 and earlier. As of Fortran
2003, Fortran does it both ways; you can choose. See fj's comments about
access='stream', known in some circles as threepwood.
(OK, the threepwood part is an "inside joke"; don't worry if you don't
get it.)
Admitedly, there are no full-language f2003 compilers yet, but there are
quite a few f95 compilers that have implemented this f2003 feature, and
the feature was modelled after compiler-specific functionality that has
been commonly available, but nonstandard and thus varying in exact
syntax, for some time.
Quite right. And as a further correction this applies to unformatted as
backspacing and partial reading of formatted records, when supported, is
based on the record structure that is indicated by the line end character
which is eithe a CR, a LF or even a CR LF pair for byte stream file systems.
Record based file systems do not need this as it is part of the file
system. Another way around this is to insist that all formatted records
be of fixed length with 80 or 132 common choices.
The overall lesson to taken is that the notion of record and the operations
that make sense on records is broader than one gets from from the typical
first course in programming on a Unix clone system. The practical effect
of this is most evident on unformatted records in Fortran.
.
- References:
- Question about READ statement
- From: Lorents
- Re: Question about READ statement
- From: fj
- Re: Question about READ statement
- From: Lorents
- Re: Question about READ statement
- From: Gordon Sande
- Re: Question about READ statement
- From: Richard Maine
- Question about READ statement
- Prev by Date: Re: how to convert variable name to a string?
- Next by Date: defined operator & assignment speed & memory usage problem
- Previous by thread: Re: Question about READ statement
- Next by thread: Re: Question about READ statement
- Index(es):
Relevant Pages
|
|