linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@mail.ru>
To: linux-hotplug@vger.kernel.org
Subject: Re: Question regarding hotplug/udev + USB key
Date: Sat, 12 May 2007 03:33:02 +0000	[thread overview]
Message-ID: <200705120733.07559.arvidjaar@mail.ru> (raw)
In-Reply-To: <C1137F1C-1450-48C1-9BFC-36550386B5FA@kinostudios.com>


[-- Attachment #1.1: Type: text/plain, Size: 2407 bytes --]

On Friday 11 May 2007, Greg wrote:
> On May 11, 2007, at 3:34 AM, Greg KH wrote:
> > Great questions, care to ask this on the linux-hotplug-devel mailing
> > list and CC me?  That way I can answer it in public to enable everyone
> > else to know the answer, and let the search engines pick it up.
>
> Sure thing! Here's my question again:
>
> I'm currently working on a project (a program written in C++) and I
> need to be notified whenever a USB key is attached to the computer
> and what the absolute path of that key is so that I can automatically
> see what's inside of it.
>
> What is the easiest and proper (modern) way of doing this?  Should I
> create a script in /etc/hotplug.d/usb or should I add a rule to the /
> etc/udev/rules.d folder? 

yet another possibility is to use HAL notifications over D-Bus (listen for 
DeviceAdded and then check for speific porperties). This way you may even 
expect more portability as udev is Linux specific and HAL is available on 
Solaris and BSD (although I do not know how complete implementation is). HAL 
specification is on 
http://people.freedesktop.org/~david/hal-spec/hal-spec.html; freedesktop.org 
also hosts D-Bus; specifically 
http://www.freedesktop.org/wiki/Software/dbus-cpp seems to provide C++ 
binding to D-Bus (but you of course can use C bindings which are more 
mature).

HTH

-andrey

> Please be aware that I'm really kind of 
> shooting in the dark here and don't really have a strong grasp on any
> of this so if you happen to know of a good link that might point me
> in the right direction to solving my problem I would appreciate that
> greatly as well (currently I'm going off of what are likely outdated
> online documents).
>
> The computer that this program will run on has a linux 2.6 kernel.
>
> Kind regards,
>
> - Greg Slepak
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> 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



[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #3: Type: text/plain, Size: 226 bytes --]

_______________________________________________
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

  reply	other threads:[~2007-05-12  3:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-11 19:44 Question regarding hotplug/udev + USB key Greg
2007-05-12  3:33 ` Andrey Borzenkov [this message]
2007-05-12 17:28 ` Greg

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=200705120733.07559.arvidjaar@mail.ru \
    --to=arvidjaar@mail.ru \
    --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).