Questions re: Removable Media
I'm writing a little app that automatically uploads mp3 files to my iPod. Obviously, things could really get screwed up if someone accidentally unplugs the iPod while its database is being updated. My questions are these:
1. Is there some API that my program can call to programmatically "lock" the iPod (i.e. prevent the eject command from unmounting the iPod)? Obviously nothing is going to stop someone from physically yanking the plug out, but at least if they try an eject and it reports failure they might get a clue.
2. Barring the lock, is there a way for my app to receive some sort of notification that the iPod has been ejected? I figure if the app can somehow be informed that the iPod is no longer mounted it can at least abort any further write attempts.
If it matters, my system is running Fedora 14.
Thanks for your help!