• 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: NSFileHandle notifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFileHandle notifications


  • Subject: Re: NSFileHandle notifications
  • From: Finlay Dobbie <email@hidden>
  • Date: Tue, 31 Jul 2001 19:44:07 +0100

On Tuesday, July 31, 2001, at 07:11 pm, Chris Kane wrote:

Why not have the file handle do the reading for you with -readInBackgroundAndNotify? I'm not sure waitForDataInBackgroundAndNotify (which uses select()) works well (gives the semantics you're expecting) on real files (as opposed to pipes or sockets).

The no-data could be because there is an error occurring (say, in the background wait) or because no data has been added to the file (your fd is still "at EOF") but select() is returning the file descriptor as readable anyway.

In any case, I'd try converting to -readInBackgroundAndNotify.

well readInBackgroundAndNotify is no use either. if you want to continuously read from a stream (like tail -f), so whenever something is written to the file you see it, then there's currently no way of doing it from the cocoa frameworks afaict.

i would've expected you to use waitForDataInBackgroundAndNotify followed by readInBackgroundAndNotify followed by waitForDataInBackgroundAndNotify or similar.

-- Finlay


References: 
 >Re: NSFileHandle notifications (From: Chris Kane <email@hidden>)

  • Prev by Date: Re: Using NSDrawer's
  • Next by Date: Re: Newbye with .. a button :-))
  • Previous by thread: Re: NSFileHandle notifications
  • Next by thread: Re: NSFileHandle notifications
  • Index(es):
    • Date
    • Thread