ProfileSystem

Last Revision:
Version 1.0, 2005-05-05
Shows how to obtain the same information that System Profiler displays.
Build Requirements:
Mac OS X 10.3.8, XCode 1.1
Runtime Requirements:
Mac OS X 10.3.8 or greater

ProfileSystem demonstrates the use of the system_profiler shell command and how it can be called by a Core Foundation application to retrieve the same information that is displayed in the System Profiler utility. The sample uses the UNIX popen call to open a stream and read the results of the system_profiler command. The resultant data is then read into a buffer and converted to a CFArray using the CFPropertyListCreateFromXMLData call. For this sample, the CFArray is then parsed for specific information about PCI and USB devices.