From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Hamilton Date: Sat, 12 Jun 2004 11:39:42 +0000 Subject: Re: How to detect whether media is present in a reader? Message-Id: <200406122339.42404.michael@actrix.gen.nz> List-Id: References: <200406101053.33097.michael@gentoo.co.nz> In-Reply-To: <200406101053.33097.michael@gentoo.co.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Thanks for the pointers. However it has just occurred to me - and please correct me if I'm wrong - that frequently polling flash media might prematurely wear it out. I guess the media should only be polled when the user tries to access it - something like the approach taken by submount - so I'm probably going to look at virtual file systems (maybe using the fuse library). On Sat, 12 Jun 2004 09:01, David Zeuthen wrote: > >... > > If I had a simple/efficient way to poll a device's media > > insertion state, I think my script could then fully automate > > almost all aspects of desktop integration of usb storage. > > > > Thanks. > > > > Hi, have you looked at the HAL project at http://hal.freedesktop.org and > gnome-volume-manager which accomplishes this task on Linux 2.6 kernels? > (It's so much easier on 2.6 thanks to sysfs). The idea is that it's > possible to port this to other kernels which is more or less a > requirement for desktop projects link GNOME or KDE. The IPC used to > communicate with the desktop session is D-BUS. > > Regarding media detection I've found that doing the equivalent of > 'blockread --rereadpt /dev/sda' every, say, 2 seconds is a good way of > polling for media. In HAL it's straightforward to blacklist or whitelist > devices where this causes trouble. > > Hope this helps, > David > > ------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X. >From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel