C++ Mac 上接口 .dmg 文件的库
我想编写一个 C++ 程序,该程序生成一个线程来执行 .dmg 文件并在 Snow Leopard 上监视其完成情况(成功/失败)。这会像 Linux 上 fork/exec shell 脚本一样简单吗?我需要第 3 方 C++ 库来连接 .dmg 文件吗?
I want to write a C++ program that spawns off a thread to execute a .dmg file and monitor its completion (success/fail) on Snow 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
OS X 上的 .dmg 文件是卷或单个文件系统映像的容器,因此不清楚执行 .dmg 文件的含义。如果您的意思是挂载 .dmg 文件中包含的文件系统,最简单的方法是使用 hdiutil 命令:
如果需要解析挂载的文件系统的信息,请使用
-plist< /code> 参数将通过 stdout 以 OS X
plist
格式返回该信息。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:
If you need to parse the information about the file systems mounted, use the
-plist
argument which will return that information in OS Xplist
format via stdout.