• 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
Re: hw.cpufamily vs ASP vs machine.h
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hw.cpufamily vs ASP vs machine.h


  • Subject: Re: hw.cpufamily vs ASP vs machine.h
  • From: Stephane Sudre <email@hidden>
  • Date: Wed, 28 Feb 2007 22:57:39 +0100


On mercredi, février 28, 2007, at 08:37 PM, Peter Bierman wrote:

On 28 févr. 07, at 10:45, Michael Smith wrote:

system_profiler -xml SPHardwareDataType


At 11:31 AM +0100 2/28/07, Stephane Sudre wrote:
This is a good last resort solution. But I would like to avoid relying on parsing because that would mean trusting nothing is changed by Apple between 2 releases.


system_profiler is the only API that provides the human readable textual description you're looking for. The -xml flag will insulate you against format changes, and is designed for machine parsing.

Well, I took a different road. I don't want to rely on system_profiler for additional reasons (one of them is the fact that the -xml SPHardwareDataType does not work on Mac OS X 10.2, another one could be not to use a tank (slow and too much information) to kill an ant).


For PowerPC, I still use the old code if the OS is too old. For i386, I use sysctl with the machdep.cpu branch and another one to get the family and to know whether it's a multi-core or mono-core CPUs.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: hw.cpufamily vs ASP vs machine.h
      • From: Garth Cummings <email@hidden>
References: 
 >Re: hw.cpufamily vs ASP vs machine.h (From: Peter Bierman <email@hidden>)

  • Prev by Date: Re: hw.cpufamily vs ASP vs machine.h
  • Next by Date: Re: hw.cpufamily vs ASP vs machine.h
  • Previous by thread: Re: hw.cpufamily vs ASP vs machine.h
  • Next by thread: Re: hw.cpufamily vs ASP vs machine.h
  • Index(es):
    • Date
    • Thread