I\'m using Linux Inotify to detect FS events on my program.
How could I be notified when a device is mounted on a monitored directory?
EDIT: Update to be less than 5 years obsolete
If you're on anything but the most ancient of systems, libudev is what you want for the first step.
If you're on something from this decade, udisks will do all of this for you, too. You'd need to watch the org.Freedesktop.DBus.ObjectManager interface on /org/freedesktop/UDisks2 to see when new filesystems turn up.