Does a system call or library exist that would allow my C++ code to use hdiutil on Mac OS X. My code needs to mount an available .dmg file and then manipulate what's inside.
C++ interface for hdiutil on Mac
1.8k Views Asked by theactiveactor At
3
There are 3 best solutions below
2

hdiutil
uses DiskImages.framework; unfortunately, the framework is private (undocumented, no headers), but if you're feeling adventurous, you can try to use it anyway.
0

hdiutil
has a -plist
argument that causes it to format its output as a standard OS X plist. See this for info on processing the output from hdiutil; because you'll likely have to examine the output a bit to find what you need, it may be easy to do this initially with something like python
. Then see here for some suggestions on parsing plists in C++.
If you can use Objective-C++, you can use NSTask to run command line tools:
If you need to use "plain" C++, you can use system():
or fork()/exec().
You'll need to double-check whether
hdiutil
actually returns 0 for success or not.