Re: NSTask and pseudo TTY

2010-03-28 Thread James W. Walker
On Mar 28, 2010, at 2:29 PM, Ken Thomases wrote: > On Mar 28, 2010, at 1:56 PM, James W. Walker wrote: > >> I've been running NSTask and reading the output using -[NSFileHandle >> readInBackgroundAndNotify], but in certain situations there was a problem: >> Due to the block buffering of stand

Re: NSTask and pseudo TTY

2010-03-28 Thread Ken Thomases
On Mar 28, 2010, at 1:56 PM, James W. Walker wrote: > I've been running NSTask and reading the output using -[NSFileHandle > readInBackgroundAndNotify], but in certain situations there was a problem: > Due to the block buffering of standard output, I wasn't getting notified as > soon as some o

Re: NSTask and pseudo TTY

2010-03-28 Thread James W. Walker
On Mar 28, 2010, at 12:06 PM, John Pannell wrote: > Hi James- > > Depending on your use case, you might be able to shut the buffering off by > something like this... > > setvbuf(stdout, NULL, _IONBF, 0); That would go in the command line tool, not in the client app, right? As I mentioned,

Re: NSTask and pseudo TTY

2010-03-28 Thread John Pannell
Hi James- Depending on your use case, you might be able to shut the buffering off by something like this... setvbuf(stdout, NULL, _IONBF, 0); Hope this helps! John On Mar 28, 2010, at 12:56 PM, James W. Walker wrote: > I've been running NSTask and reading the output using -[NSFileHandle > r

NSTask and pseudo TTY

2010-03-28 Thread James W. Walker
I've been running NSTask and reading the output using -[NSFileHandle readInBackgroundAndNotify], but in certain situations there was a problem: Due to the block buffering of standard output, I wasn't getting notified as soon as some output had been produced. I don't have control over the code