|
One possible way would be to use hal.
If there's a disk in the drive then lshal should show it. If you run "lshal -m" (monitor mode) as you insert the disk, it will show you what entries get added. Then you can use "lshal |grep [one of those lines]" to determine when a disk is present. I believe it can display when a device is mounted as well.
Note that I'm not a hal expert though, so there are probably better ways to go about it.
|