Re: Read File Problems
Re: Read File Problems
- Subject: Re: Read File Problems
- From: Shane Stanley <email@hidden>
- Date: Tue, 20 Mar 2001 15:11:37 +1100
On 20/3/01 2:27 PM +1000, Paul Berkowitz, email@hidden, wrote:
>
So -- what's the point of the 'write permission' parameter, if the _only_
>
thing you need to open for access for is to write to the file? If you can
>
read it and get eof without opening it for access, you actually only need to
>
open it in order to write to it, so why the special parameter 'with write
>
permission'?
Opening the file first has considerable advantages if you're not reading the
whole thing in at once -- it's quicker, and it automatically keeps track of
where you're up to.
I used to use a simple read for shorter files, but I started having problems
with scripts written that way. I _think_ it involved one or more versions of
system software, and whether the script had previously read/written to the
same file.
In any event, I decided that it's easy enough to use close/open and play it
safe.
--
Shane Stanley, email@hidden