For Programmers: Free Programming Magazines  


Home > Archive > Fortran > October 2006 > Re: Why these original FORTRAN quirks?; Now : Programming









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Why these original FORTRAN quirks?; Now : Programming
Steve O'Hara-Smith

2006-10-30, 7:15 pm

On Fri, 27 Oct 2006 00:53:05 -0700
glen herrmannsfeldt <gah@ugcs.caltech.edu> wrote:

> Rostyslaw J. Lewyckyj wrote:
>
> (snip)
>
>
> That is also the PASCAL way, I don't know which came first.
>
> The C way is that you test for EOF only after you have tried to
> read past the end of file, more like the Fortran way.
>
> Since most OS that I know of don't give an end of file indication
> until you actually try to read more, the PASCAL way would seem to
> require a complicated buffering system, reading one record ahead.


Not really, all that is required is an EOF flag that gets set on
open (usually to false but to true if the file is empty) and then gets set
after every read if that read has pushed the file pointer to the end.

--
C:>WIN | Directable Mirror Arrays
The computer obeys and wins. | A better way to focus the sun
You lose and Bill collects. | licences available see
| http://www.sohara.org/
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com