Lion changes
Lion changes
- Subject: Lion changes
- From: Leonardo <email@hidden>
- Date: Thu, 21 Jul 2011 17:28:00 +0200
- Thread-topic: Lion changes
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