Note: I am not on the linux-usb-users mailing list, please Cc: me! Thanks in advance!
I have a SanDisk ImageMate USB CompactFlash reader (model SDDR-73), which I use on my SuSE Linux 8.1 box (kernel 2.4.19).
I've written some shell scripts to automatically mount, download all JPEG files, then umount my CompactFlash, which works pretty well except if I run it without a CompactFlash in the reader (or if it isn't properly seated, of course). The mount command takes a very long time, and usually ends up with my system completely frozen.
While I would of course prefer it to say "no device" or something equally sensical and fail the mount, I am prepared to accept that the driver might be imperfect. But I'd very much like to know if there is a way that I could detect whether there is something or not, so I could add a test in my shell scripts and avoid mounting it.
I have tried doing a "strace dd if=/dev/sda1 of=/dev/null bs=512 count=1", and I can see the read() block and it seems to be interruptible without visible side-effects, but I don't really know how I could harness this in a shell script (it also requires root permission, but I could hack around this, I guess)... Is there anything I could look up in /proc for example to find out in advance?
-- Pierre Phaneuf http://advogato.org/person/pphaneuf/ "I am denial, guilt and fear -- and I control you"
------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users
