Detecting and Writing to a USB Key / Thumb DriveAutomatically

对着背影说爱祢 提交于 2020-01-07 06:38:21

问题


I've been fighting with this for quote a while now: I'm trying to automatically detect the insertion of a USB key in Angstrom linux, but it's proven to be really tough. I unfortunately don't know a ton about linux and the file system, so any points come with quote a bit of gratitude.

Right now I'm having a bit of trouble just detecting the USB key.

My strategy so far has been to parse /proc/mounts to look for the mount points and write to those.

Is this the best way?


回答1:


Yes, better way is to use udev. You haven't written which language you use, but udev can be used with DBus or you can use libudev.



来源:https://stackoverflow.com/questions/7413197/detecting-and-writing-to-a-usb-key-thumb-driveautomatically

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!