• 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: NSTask oddity with getting stdout
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask oddity with getting stdout


  • Subject: Re: NSTask oddity with getting stdout
  • From: Shane Stanley <email@hidden>
  • Date: Wed, 27 Jul 2011 09:52:42 +1000
  • Thread-topic: NSTask oddity with getting stdout

On 27/7/11 3:18 AM, "Scott Ribe" <email@hidden> wrote:

> Maybe you should try to re-open your bug ;-)

I did, but no reply.

Here's some code that's reading a file that's being written periodically:

-(void)dataFromFile:(NSNotification *)notif {
    NSData *data = [[notif userInfo]
objectForKey:NSFileHandleNotificationDataItem];
    if ([data length]) {
     // do stuff
   }
   [[notif object] readInBackgroundAndNotify]; // call again
}

In Snow Leopard that worked fine; a notification would be sent when new data
was written to the file. In Lion, as soon as it's called it goes into a
loop; each time readInBackgroundAndNotify is sent, a new notification comes
straight back.


--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSTask oddity with getting stdout
      • From: Scott Ribe <email@hidden>
References: 
 >Re: NSTask oddity with getting stdout (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: Creating a TCP server?
  • Next by Date: Re: Creating a TCP server?
  • Previous by thread: Re: NSTask oddity with getting stdout
  • Next by thread: Re: NSTask oddity with getting stdout
  • Index(es):
    • Date
    • Thread