Re: End of file error
Re: End of file error
- Subject: Re: End of file error
- From: Shane Stanley <email@hidden>
- Date: Tue, 16 Jan 2001 18:31:49 +1100
On 16/1/01 5:56 PM +1000, Paul Berkowitz, email@hidden, wrote:
>
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?
32K is no problem, although a much bigger amount may cause a (different)
error, depending on memory allocation. If that's at all likely, you might as
well just "get eof" first, to cover all bases.
(You will also get an error if you use the form "read for x" if x is greater
than the length of the file.)
--
Shane Stanley, email@hidden