Thanks.

How would I go about checking to see if a card is in the drive?  Trying to
open() the block device and see if it succeeds?

cheers,

John.

----- Original Message ----- 
From: "Alan Stern" <[EMAIL PROTECTED]>
To: "John Matthews" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, August 12, 2004 2:43 PM
Subject: Re: [Linux-usb-users] Compact Flash Reader : Detecting that a card
has been inserted.


> On Thu, 12 Aug 2004, John Matthews wrote:
>
> > Hi,
> >
> > I have a standard usb compact flash reader which works using the
usb-storage
> > section of the kernel.
> >
> > I need to know when a card is being inserted.  Windows knows this so it
must
> > be possible.  Has anyone ever attempted to get this working on linux?
> > Does/could hotplug deal with this?
> >
> > All information gratefully recieved,
> >
> > John Matthews.
>
> There may be people who have solved this problem, but I can't point you to
> any.  Hotplug won't help, since inserting a card doesn't generate a
> hotplug event until the kernel realizes the card is there.  The only way
> this can happen is for a user process to try to access the card; there's
> no way for the reader to tell the kernel that a card has been inserted
> until the kernel asks, and the kernel won't ask on its own.
>
> So the only possibility is to have a program which periodically (once a
> second or once every few seconds) queries the reader.  I believe that's
> how Windows does it.
>
> Alan Stern
>
>
>



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to