开发者

C++ library to interface .dmg files on Mac

开发者 https://www.devze.com 2022-12-15 05:25 出处:网络
I want to write a C++ program that spawns off a thread to execute a .dmg file and monitor its completion (success/fail) on S开发者_StackOverflow中文版now Leopard. Would this be as trivial as fork/exec

I want to write a C++ program that spawns off a thread to execute a .dmg file and monitor its completion (success/fail) on S开发者_StackOverflow中文版now Leopard. Would this be as trivial as fork/exec a shell script on Linux? Would I need a 3rd party C++ library to interface .dmg files?


A .dmg file on OS X is a container for an image of a volume or single file system so it's not clear what you mean by execute a .dmg file. If you mean mount the file systems contained in the .dmg file, the easiest way to do that is with the hdiutil command:

hdiutil attach /path/to/file.dmg

If you need to parse the information about the file systems mounted, use the -plist argument which will return that information in OS X plist format via stdout.

0

精彩评论

暂无评论...
验证码 换一张
取 消