Re: Problem with reading an NSPipe->NSFileHandle to end

2010-04-12 Thread Ken Thomases
On Apr 12, 2010, at 8:46 AM, Rasmus Skaarup wrote: >> Try simplifying your app by eliminating the use of background threads. Or, >> if you feel you must use background threads for long-running computation, >> use them only for handling the data after receiving it. Do everything >> involving l

Re: Problem with reading an NSPipe->NSFileHandle to end

2010-04-12 Thread Rasmus Skaarup
> Try simplifying your app by eliminating the use of background threads. Or, > if you feel you must use background threads for long-running computation, use > them only for handling the data after receiving it. Do everything involving > launching the task and initiating background reads of it

Re: Problem with reading an NSPipe->NSFileHandle to end

2010-04-11 Thread Jens Alfke
You could use MYTask, or at least look at how it’s implemented, instead of writing your own code. NSTask is surprisingly tricky to use if you want to read the task output. http://bitbucket.org/snej/myutilities/src/tip/MYTask.h —Jens___ Cocoa-dev mail

Re: Problem with reading an NSPipe->NSFileHandle to end

2010-04-11 Thread Ken Thomases
On Apr 11, 2010, at 3:18 PM, Rasmus Skaarup wrote: > On 11/04/2010, at 21.17, Ken Thomases wrote: > >> On Apr 8, 2010, at 9:57 AM, Rasmus Skaarup wrote: > >>> [[NSNotificationCenter defaultCenter] addObserver:self >>> >>>

Re: Problem with reading an NSPipe->NSFileHandle to end

2010-04-11 Thread Rasmus Skaarup
On 11/04/2010, at 21.17, Ken Thomases wrote: > On Apr 8, 2010, at 9:57 AM, Rasmus Skaarup wrote: >> [[NSNotificationCenter defaultCenter] addObserver:self >> >> selector:@selector(threadPipeReader:) >>

Re: Problem with reading an NSPipe->NSFileHandle to end

2010-04-11 Thread Ken Thomases
On Apr 8, 2010, at 9:57 AM, Rasmus Skaarup wrote: > I'm trying to execute a task in the background and parsing the output from > the task along the way. However I get the NSTaskDidTerminateNotification > before all the output from the task has been delivered by > NSFileHandleReadCompletionNotif