On Thursday 13 March 2008 02:17, [EMAIL PROTECTED] wrote:
> ?? Does anyone know how I can detect new hardware (like a USB flash drive)
> within my Linux application? Is there a way to get the kernel to inform my
> process that there is a new device? Thanks.

The answer is and isn't simple. Your first resource would be:

http://linux-hotplug.sourceforge.net/

Here is the QuickAnswer (PatentPending):

When you insert a USB flash drive, EVENTUALLY, /sbin/hotplug is called (see 
http://linux-hotplug.sourceforge.net/?selected=hotplug). What is IMPORTANT is 
that several environment variables are set depending on the device.

For USB you would look at http://linux-hotplug.sourceforge.net/?selected=usb 
which tells you what environment variables are set.

The rest is either:

a) scripts
b) a specialized program

I know of one solution that periodically looked in /proc, but I'm not sure 
that is the ideal solution.

Good luck!

Lloyd
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to