Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
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.
Copyright © 2005 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2005-05-05