On May 13, 7:21 am, GaryScott <garylsc...@[EMAIL PROTECTED]
> wrote:
> On May 13, 2:42 am, robert.corb...@[EMAIL PROTECTED]
wrote:
> > The Fortran standard allows implementations to work as you want them
> > to work, but it does not require implementations to work as you want
> > them to work. Section C.6.2 of the Fortran 2003 standard gives an
> > informative example. Different Fortran implementations work
> > differently in this regard. Some always flush at the end of a
> > nonadvancing WRITE. Some never flush. Some flush if the unit to
> > which the data is written is connected to a tty or a ptty. Some
> > flush if the unit is connected to standard output or standard error.
> > All of these behaviors are permitted by the Fortran standard.
>
> This area of implementation is a mess. I think we should beef the
> standard up a little here. We need to flush for interactive line-mode
> terminals, probably pipes (or VM console/program stack), and shared
> access-mode disk files, at least. Page mode terminals like 3270 I'm
> not certain of whether it would be useful.
One problem is that nonadvancing I/O serves more than one role.
It can be used for prompts, as the OP intended. It can also be
used to build records a piece at a time. In the latter case,
flu****ng at the end of each WRITE is not only costly in time,
but it eliminates some functionality (consider tab edit
descriptors). One approach to minimizing the costs is to use
lazy I/O, but I don't know of any implementations that do.
Even lazy I/O won't do what the user wants in all cases.
Bob Corbett


|