Mac OS X Reference Library Apple Developer Connection spyglass button

Version: 1.0

Posted: 2005-05-05

Build Requirements: Mac OS X 10.3.8, XCode 1.1

Runtime Requirements: Mac OS X 10.3.8 or greater

View Source Code:

Download Sample Code (“ProfileSystem.zip”, 13.3K)



Description

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.

Document Revision History

Date Notes
2005-05-05Shows how to obtain the same information that System Profiler displays.
Did this document help you? Yes It's good, but... Not helpful...