Re: NSTask(syslog)->NSPipe->NSFileHandle->readInBackgroundAndNotify buffers
Re: NSTask(syslog)->NSPipe->NSFileHandle->readInBackgroundAndNotify buffers
- Subject: Re: NSTask(syslog)->NSPipe->NSFileHandle->readInBackgroundAndNotify buffers
- From: Ken Thomases <email@hidden>
- Date: Wed, 11 Jun 2008 16:05:58 -0500
On Jun 11, 2008, at 3:10 PM, Jason Bobier wrote:
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?
I believe that this is out of the control of your Cocoa process. It's
under the control of the child syslog process. It might be changing
its behavior based on whether its output is going to a tty device, but
I'm not sure.
You should consider using the ASL (Apple System Log) API, instead.
It's Apple's more modern replacement for syslog. For backward
compatibility, I believe it's hooked into syslogd, but ASL is the
"native" logging facility. There's a great series of blog posts about
ASL here: <http://boredzo.org/blog/archives/2008-01-19/next-week-apple-system-logger
>.
Good luck,
Ken
_______________________________________________
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