Results 1 to 4 of 4
Hi All,
How do i detect insertion/removal of external devices like SD card, USB devices etc., in my program, which should be running in thread. If single API is available, ...
- 07-10-2009 #1Just Joined!
- Join Date
- Jul 2009
- Posts
- 3
How do i detect insertion/removal of devices?
Hi All,
How do i detect insertion/removal of external devices like SD card, USB devices etc., in my program, which should be running in thread. If single API is available, it will be too good. Otherwise, please suggest me the how to achieve that.
Regards,
Pramod
- 07-10-2009 #2Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
Hardware detection and management is handled by udev. You might want to add rules to udev to talk to your application which is the most direct way or alternatively you can directly look at kernel messages/dmesg to detect any change.
- 07-10-2009 #3Just Joined!
- Join Date
- Jul 2009
- Posts
- 3
Can u please help me for coding?
- 07-10-2009 #4Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
There's a lot to it and I've only had a brief encounter with creating rules. I'd recommend you have a read up on the system and how to built udev rules:
Writing udev rules


Reply With Quote