login
Header Space

 
 

How to detect usb device insertioin and removal event ?

October 3, 2008 - 11:05am
Submitted by Anonymous on October 3, 2008 - 11:05am.
Linux

Hi

I need to write a user application that detects Usb device ( disc or printer) insertion and removal

How to achieve that?

Does inotify allow to detect usb device insertion and removal?

Or is there others ways to do that ?

Any comment sis welcome

Hello, I think you can start

October 7, 2008 - 3:41am
Anonymous (not verified)

Hello,

I think you can start with udevadm application - just like that:

udevadm monitor

While you insert or remove usb device you'll be seeing messages from udev printed by this programm.
Then you can dig on your own how it's done in sources code of udevadm.

sdrb

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
speck-geostationary