NSTask(syslog)->NSPipe->NSFileHandle->readInBackgroundAndNotify buffers
NSTask(syslog)->NSPipe->NSFileHandle->readInBackgroundAndNotify buffers
- Subject: NSTask(syslog)->NSPipe->NSFileHandle->readInBackgroundAndNotify buffers
- From: Jason Bobier <email@hidden>
- Date: Wed, 11 Jun 2008 16:10:43 -0400
Hey folks, I know that this has been discussed here before, but after
spending hours reading cocoa-dev posts, I have yet to find the solution.
The issue that I'm having is that I'm using NSTask to create a syslog
process with the -w option to continually parse specific syslog
entries. The problem is that if there are too few entries, I never
receive the notification.
I understand that along the way, something is buffering the data. How
do I turn that off?
Here's some more info:
it works fine if I don't use the -w with syslog(i.e. I allow the task
to complete)
syslog appears to linebuffer to the terminal
Here's what I've tried:
fcntl F_NOCACHE on the fileHandleForReading file descriptor returns -1
adding NSUnbufferedIO to the environment of the NSTask doesn't appear
to do anything
Thanks greatly for the help,
Jason
_______________________________________________
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