Re: End of file error
Re: End of file error
- Subject: Re: End of file error
- From: Nigel Garvey <email@hidden>
- Date: Wed, 17 Jan 2001 00:17:05 +0000
Paul Berkowitz wrote on Mon, 15 Jan 2001 22:56:52 -0800:
>
It seems that when a text file is completely blank, and you open it for
>
access and try to read it, you get an "end of file error" which can mess up
>
a script unless you trap it. Are there other circumstances which result in
>
this same error, or can it be assumed that a file is always empty? I think a
>
file length greater than 32K would also do it, yes? That can be tested for,
>
too. Anything else?
Not so likely in your case, Paul, but these are possibilities:
1) If you've specified a 'to' parameter that is beyond the end of the
file.
2) If you've already read (or written) through to the end of the file
using the returned 'open' reference - so that the file pointer for the
reference is at eof - and are trying to read it again without using 'from
1'.
3) If you're referring to the file by file specification instead of by
'open' reference and the file is still open from having been read through
with another reference and the 'read' command adopts the other reference
instead of the one you've just opened.
4) If, between the time you open the file and the time you read it, some
other process using a file specification hijacks your reference and reads
the entire file.
NG