On Aug 13, 2012, at 6:52 PM, Andy Lee wrote: > You're very welcome. Although I wonder if you could simply replace the > do-while loop with a call to NSTask's waitUntilExit method.
You can't unless you issue a -read..InBackgroundAndNotify method on the output file handle. Otherwise, if you're not reading from the pipe, it can fill up and block the task. Then you're deadlocked. Also, -waitUntilExit has the nasty problem of running the run loop in the default mode. On the main thread, that mode is likely to have various and sundry sources and timers scheduled on it. That means that they may fire during your call to -waitUntilExit, which can have unpleasant side effects that you weren't expecting, possibly including recursion. Regards, Ken _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com