Detecting and Writing to a USB Key / Thumb DriveAu

2019-09-11 07:43发布

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条回答
走好不送
2楼-- · 2019-09-11 08:07

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.

查看更多
登录 后发表回答