处理 Linux 和 Mac 上的可移动媒体 USB/CD-ROM 安装/卸载事件

发布于 2024-11-10 14:23:53 字数 326 浏览 1 评论 0原文

我需要为可移动媒体安装/卸载事件实现跨平台处理程序。在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

指尖凝香 2024-11-17 14:23:53

在 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/

扎心 2024-11-17 14:23:53

从这里开始:编写 udev 规则

Start here: Writing udev rules

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文