Re: Lion changes
Re: Lion changes
- Subject: Re: Lion changes
- From: vincent habchi <email@hidden>
- Date: Thu, 21 Jul 2011 19:33:51 +0200
Hi,
> NSString *tempFilePath = @"/Users/john/OutCocoa.txt";
> NSString *commandLine = [NSString stringWithFormat:@"/sbin/ifconfig en0 |
> grep ether | cut -d' ' -f 2 > \"%@\" 2>&1", tempFilePath];
> sprintf(cmd, "/bin/sh -c %s", [commandLine UTF8String]);
Quote the command.
sprintf (cmd, "/bin/sh -c \"%s\"", [commandLine UTF8String]);
But anyhow, as somebody pointed out, there are far better ways to get the MAC address of the en0 port than executing BSD commands in a subprocess.
Vincent_______________________________________________
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