usb card reader. Which event is generated when medium is inserted?
From: Andy Richardson (andy_at_mrbumpy.co.uk)
Date: 10/31/05
- Previous message: Fred: "psaux port and 2.6 kernels - Mouse doesn't work?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 31 Oct 2005 12:16:27 +0000
Hi folks. I have been set a task which I can complete but I'd like to
know if there is a more elegant way.
I have been asked to provide a simple camera card viewer for a
photography shop.
The aim is for the customer to plug in the card into a usb lots-in-1
card reader and this launches a window showing thumbnails of any images
on their card.
I need to know if there is any event generated when a card is inserted.
Easy with a pen drive, dmesg tells me when a usb pendrive has been
plugged in and tells me the device name to use (e.g. /dev/sde1 )
Unfortunately nothing seems to show when a card is put into the reader.
I usually try a series of mount commands until one doesn't give a "no
medium found" error.
Even /proc/partitions seems no use because it knows nothing until after
I have checked for the medium myself anyway.
autofs doesn't seem to do what I'm after. It mounts a device only when
you go looking for it.
udev is more about detecting your different pendrives and mounting them
differently depending on which device you have plugged in.
At the moment I'm thinking of writing a script which continually
attempts to mount a series of /dev/sd? until one succeeds and then
search for images etc..
Alternatively I could use autofs and keep trying to view the directories
until eventually one is not empty.. and succeeds.
In short....... is there a more elegant solution?
I'm running VectorLinux with kernel 2.6.14
thanks
-- Andy Richardson Never criticize a man 'til you've walked a mile in his shoes. After that, you can say what you like.. 'cos you're a mile away and you've got his shoes.
- Previous message: Fred: "psaux port and 2.6 kernels - Mouse doesn't work?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|