Detecting and Writing to a USB Key / Thumb DriveAutomatically
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.
精彩评论