Re: detecting end of a direct access file

Arjen Markus <arjen.markus895@xxxxxxxxx> wrote:

On 27 mrt, 05:12, tho...@xxxxxxxxxxxx wrote:
Is there a portable way to detect the end of a direct access file
while at the same time distinguishing it from other kinds of read

No, there is not. In fact, there is no portable way to guarantee that
such a read will even get an error at all. It might just suceed and
return bogus data. It is easy to imagine implentations and situations
where that would happen; I believe such might even have existed.
(Picture implementations that allocate such files in blocks that could
be bigger than the record size).

Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain

Relevant Pages

  • Re: Problem to pass complex array between subroutine and main program
    ... Arjen Markus wrote: ... some compilers and there is a "technical report" about the ... allocatable arrays. ... It makes no sense to also allocate it in the ...
  • Re: a flexible number of derived type
    ... Arjen Markus wrote: ... I'd like to define a derived type training_class which has flexible no. ... You will have to allocate it for every varialbe of the type ... It turns out the statement of the allocating memory is very long. ...