LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Questions re: Removable Media (http://www.linuxquestions.org/questions/linux-general-1/questions-re-removable-media-925850/)

swarga 01-26-2012 03:25 PM

Questions re: Removable Media
 
Hi all,

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!

kareempharmacist 01-26-2012 05:39 PM

http://ifile.it/uo5ey4/__Linux_Devic...rd_Edition.pdf


http://ifile.it/zh5xo8/__USB_Mass_St...dded_Hosts.pdf

kareempharmacist 01-26-2012 05:54 PM

http://www.linuxquestions.org/linux/...ing_Libusb_API

kareempharmacist 05-28-2012 05:07 PM

In Linux every device is represented by file so the ipod will be a file in /dev ..check this out
http://linux.about.com/od/srl_howto/a/hwtsrl15t02.htm



http://en.wikipedia.org/wiki/File_locking

kareempharmacist 12-31-2012 10:13 AM

did you manage to solve your problem and find out how to do it?
if yes ,please mark the thread as "solved"


All times are GMT -5. The time now is 02:39 PM.