Re: Using NSPipe to get system command output
Re: Using NSPipe to get system command output
- Subject: Re: Using NSPipe to get system command output
- From: Jens Alfke <email@hidden>
- Date: Mon, 13 Aug 2012 15:09:24 -0700
On Aug 13, 2012, at 2:17 PM, Charlie Dickman <email@hidden> wrote:
> int vmDataLength = 0;
> do {
> vmData = [vmRead availableData];
> vmDataLength = [vmData length];
> } while (vmDataLength != 0);
Don't you mean "== 0" on the final line?
Also, spin-loops like this are a really bad idea — this loop is going to consume something like 100% CPU. If you have to loop like this, run the current run loop in between tests.
—Jens
_______________________________________________
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