• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Lion changes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Lion changes
      • From: vincent habchi <email@hidden>
    • Re: Lion changes
      • From: "Gary L. Wade" <email@hidden>
  • Prev by Date: Help with Secondary UINavigationController
  • Next by Date: Re: Lion changes
  • Previous by thread: Re: Help with Secondary UINavigationController
  • Next by thread: Re: Lion changes
  • Index(es):
    • Date
    • Thread