From: Michael Hamilton <michael@actrix.gen.nz>
To: linux-hotplug@vger.kernel.org
Subject: Re: How to detect whether media is present in a reader?
Date: Sat, 12 Jun 2004 11:39:42 +0000 [thread overview]
Message-ID: <200406122339.42404.michael@actrix.gen.nz> (raw)
In-Reply-To: <200406101053.33097.michael@gentoo.co.nz>
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
next prev parent reply other threads:[~2004-06-12 11:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-09 22:53 How to detect whether media is present in a reader? Michael Hamilton
2004-06-09 22:57 ` Michael Hamilton
2004-06-09 23:34 ` Greg KH
2004-06-11 21:01 ` David Zeuthen
2004-06-12 11:39 ` Michael Hamilton [this message]
2004-06-12 12:21 ` David Zeuthen
2004-06-14 20:33 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200406122339.42404.michael@actrix.gen.nz \
--to=michael@actrix.gen.nz \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).