How to detect USB drives that has been inserted/removed?
I am new to Linux. I have to write a C library which has to detect USB device such as Mass Storage devices that has been inserted/removed. And it has to notify to a Java application with Mass Storage Device's Label, Device ID. And as well as once it has been identified, it has to mount to a location and it has to send the mounted location to Java App.
I have tried using iNotify and by reading /proc/partitions. But i didnt succeed. Because iNotify is not giving notification for /proc/partitions as well as i m unable to read /proc/partitions through File IO in C.
Or Is there any built-in library which we can register for USB notification?
Please provide me suggestion to accomplish this task.
Thanks and Regards,
Win an iPhone 6
Enter to Win
|Geek Hide-away in Guatemala - Stay for Free!||Nov 26, 2015|
|Microsoft and Linux: True Romance or Toxic Love?||Nov 25, 2015|
|Non-Linux FOSS: Install Windows? Yeah, Open Source Can Do That.||Nov 24, 2015|
|Cipher Security: How to harden TLS and SSH||Nov 23, 2015|
|Web Stores Held Hostage||Nov 19, 2015|
|diff -u: What's New in Kernel Development||Nov 17, 2015|
- Microsoft and Linux: True Romance or Toxic Love?
- Cipher Security: How to harden TLS and SSH
- Non-Linux FOSS: Install Windows? Yeah, Open Source Can Do That.
- Web Stores Held Hostage
- Firefox's New Feature for Tighter Security
- Geek Hide-away in Guatemala - Stay for Free!
- It's a Bird. It's Another Bird!
- PuppetLabs Introduces Application Orchestration
- diff -u: What's New in Kernel Development
- IBM LinuxONE Provides New Options for Linux Deployment