以编程方式从 Java 卸载驱动器

发布于 2024-12-24 19:13:58 字数 99 浏览 5 评论 0原文

有谁知道如何在 OSx 中卸载 java 中的驱动器

我正在尝试从 java 卸载 sdcard。我正在使用 java Swing 类,驱动器会自动安装,但如何卸载它。

Does anyone knows how to unmount a drive in java in OSx

I am trying to unmount a sdcard from java. I am using java Swing class and the drive gets mounted automatically, but how do I unmount it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

早茶月光 2024-12-31 19:13:58

挂载/卸载的概念与平台无关,因此它不直接存在于 Java API 中。您很可能必须使用 Runtime.exec() 发出命令行调用来卸载。

可能有开源库可以为您包装此 exec 调用,但是我不积极。

The concept of mounting/unmounting is not platform agnostic, so it doesn't exist directly within the Java APIs. You will most probably have to issue a command line call to unmount by using Runtime.exec()

There might be open source libraries available that wrap this exec call for you, but I'm not positive.

得不到的就毁灭 2024-12-31 19:13:58

You could call umount using Runtime.exec. Of course, this solution is not portable.

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