Re: Lion changes
Re: Lion changes
- Subject: Re: Lion changes
- From: "Gary L. Wade" <email@hidden>
- Date: Thu, 21 Jul 2011 08:49:52 -0700
Rather than using other processes, look into the System Configuration framework.
- Gary L. Wade (Sent from my iPhone)
On Jul 21, 2011, at 8:28 AM, Leonardo <email@hidden> wrote:
> Hi,
> while on MacOs X 10.6 and earlier this piece of code worked properly, on
> Lion I get a different result (bug).
> I have to take the MacAddress en0. May you please tell me where I do wrong?
>
> 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]);
>
> On Leopard this code returned the true en0 (good).
> On Lion this code returns 3 MacAddresses, where the en0 is the 3rd one
> (bug). I have fixed the bug just deleting the "/bin/sh -c " in front of the
> command, this way:
> sprintf(cmd, "%s", [commandLine UTF8String]);
>
> So now on Lion it works well too. My questions are:
> 1) Will it work well on any machine?
> 2) Will it work well on Leopard too?
> 3) Why do I get the bug on Lion only?
>
> Of course I am getting a lot of troubles with machines who are trying to run
> my app on Lion today...
>
>
> Regards
> -- Leonardo
_______________________________________________
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