处理 Linux 和 Mac 上的可移动媒体 USB/CD-ROM 安装/卸载事件
我需要为可移动媒体安装/卸载事件实现跨平台处理程序。在 Windows
上实现它并不难,现在我需要在 Linux
上的 Mac
上进行冲洗和重复。我认为这些平台以不同的方式处理可移动媒体。我应该研究哪些 API?
另一方面,关于 API。 MSDN 是一个非常好的资源,提供所有框架的所有 Windows API,微软对此表示赞赏。是否有针对 Mac 和 Linux 开发的类似资源,其中所有 API 的所有文档都经过整合并且易于搜索/导航?
编辑:对于 Mac 方面,DiskArbitration 框架似乎可以完成这项工作。
I need to implement cross platform handler for the removable media mount/umount events. It was not hard to implement it on Windows
, now I need to rinse and repeat on Mac
on Linux
. I suppose that these platforms handle the removable media in different manners. Which APIs should I look into?
On another note, about the APIs. MSDN is a pretty good resource for all Windows APIs for all the frameworks, thumbs up Microsoft. Are there similar resources for Mac and Linux development, where all the docs for all the APIs are consolidated and easy to search/navigate through?
Edit: For the Mac side of things there is DiskArbitration framework that seems to do the work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Linux 上,您可以编写 udev 规则来获取有关此类事件的通知。以下是有关 udev 规则和您的场景的具体信息: http://reactivated.net/writing_udev_rules.html# external-run
Linux 的 MSDN(或至少是其中的一部分)是手册页。这是在线副本:http://linux.die.net/man/
On Linux you would write a udev rule to get notifications on such events. Here is specific info about udev rules and your scenario: http://reactivated.net/writing_udev_rules.html#external-run
The MSDN of Linux (or at least part of it) are the man pages. Here is an online copy: http://linux.die.net/man/
从这里开始:编写 udev 规则
Start here: Writing udev rules