开发者

Detecting and Writing to a USB Key / Thumb DriveAutomatically

开发者 https://www.devze.com 2023-04-04 13:59 出处:网络
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

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 ha开发者_开发百科ving 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号