Skip navigation.
 
mlNSTask(syslog)->NSPipe->NSFileHandle->readInBackgroundAndNotify buffers
FROM : Jason Bobier
DATE : Wed Jun 11 22:10:43 2008

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

Related mailsAuthorDate
mlNSTask(syslog)->NSPipe->NSFileHandle->readInBackgroundAndNotify buffers Jason Bobier Jun 11, 22:10
mlRe: NSTask(syslog)->NSPipe->NSFileHandle->readInBackgroundAndNotify buffers Ken Thomases Jun 11, 23:05
mlRe: NSTask(syslog)->NSPipe->NSFileHandle->readInBackgroundAndNotify buffers Jason Bobier Jun 11, 23:22