Re: hw.cpufamily vs ASP vs machine.h
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On mercredi, février 28, 2007, at 08:37 PM, Peter Bierman wrote: On 28 févr. 07, at 10:45, Michael Smith wrote: _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... 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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Stephane Sudre