Re: NSTask oddity with getting stdout
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