What is the Equivalent of Windows WMI for MacOS C++ Development?

和自甴很熟 提交于 2019-12-21 09:06:11

问题


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?

Links to API documentation or tutorials are very welcome.


回答1:


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.



来源:https://stackoverflow.com/questions/3613369/what-is-the-equivalent-of-windows-wmi-for-macos-c-development

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!