Windows WMI for MacOS C ++开发的等效功能是什么? [英] What is the Equivalent of Windows WMI for MacOS C++ Development?
问题描述
我有一个C ++应用程序,可以使用WMI在Windows上获取详细的系统信息(处理器类型,可用磁盘空间,其他硬件配置文件信息).我想在OSX 10.5+上执行相同类型的操作. MacOS的等效API或接口是什么?
I have a C++ application that gets detailed system information (processor type, available disk space, other hardware profile info) on Windows using WMI. I want to perform the same type of operations on OSX 10.5+. What is the equivalent API or interface for MacOS?
非常欢迎链接到API文档或教程.
Links to API documentation or tutorials are very welcome.
推荐答案
您可以通过system_profiler
可执行文件查询大多数信息. 苹果公司查询此类信息的示例涉及到popen
调用它,所以我想这是要走的路.
You can query most of that information through the system_profiler
executable. Apple's example for querying such informations involves a popen
call to it, so I guess it's the way to go.
这篇关于Windows WMI for MacOS C ++开发的等效功能是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!