• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Read File Problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Read File Problems (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: How to use [Betrayed by my email client]
  • Next by Date: Re: Help; I did something stupid!
  • Previous by thread: Re: Read File Problems
  • Next by thread: Re: Read File Problems
  • Index(es):
    • Date
    • Thread