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,
- Readers' Choice Awards 2013
- Linux Kernel News - November 2013
- Advanced Hard Drive Caching Techniques
- December 2013 Issue of Linux Journal: Readers' Choice
- Mars Needs Women
- Sublime Text: One Editor to Rule Them All?
- Raspberry Pi: the Perfect Home Server
- RSS Feeds
- Web Administration Scripts
- Linux Systems Administrator
- animal pajamas
49 min 15 sec ago
- thanks for you post.
56 min 5 sec ago
- thanks for share, great
18 hours 9 min ago
- There are factors which are
23 hours 9 min ago
- Gnome 3 ?
23 hours 54 min ago
- Reply to comment | Linux Journal
1 day 4 hours ago
- "Redis RethinkDB 4.5%" on Best NoSQL Databases
1 day 14 hours ago
- on the ground
1 day 20 hours ago
- I was able to read the whole
1 day 21 hours ago
- since i have read the title i
2 days 1 hour ago