问题
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