* Question regarding hotplug/udev + USB key
@ 2007-05-11 19:44 Greg
2007-05-12 3:33 ` Andrey Borzenkov
2007-05-12 17:28 ` Greg
0 siblings, 2 replies; 3+ messages in thread
From: Greg @ 2007-05-11 19:44 UTC (permalink / raw)
To: linux-hotplug
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? 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question regarding hotplug/udev + USB key
2007-05-11 19:44 Question regarding hotplug/udev + USB key Greg
@ 2007-05-12 3:33 ` Andrey Borzenkov
2007-05-12 17:28 ` Greg
1 sibling, 0 replies; 3+ messages in thread
From: Andrey Borzenkov @ 2007-05-12 3:33 UTC (permalink / raw)
To: linux-hotplug
[-- 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question regarding hotplug/udev + USB key
2007-05-11 19:44 Question regarding hotplug/udev + USB key Greg
2007-05-12 3:33 ` Andrey Borzenkov
@ 2007-05-12 17:28 ` Greg
1 sibling, 0 replies; 3+ messages in thread
From: Greg @ 2007-05-12 17:28 UTC (permalink / raw)
To: linux-hotplug
Thanks Andrey, I'll have a look at this.
So there are three different ways of accomplishing this task? What
are the pros and cons of each method? (Such as ease of use,
stability, support, speed, etc). And what would be the best one for
me to use for what I'm trying to do, or are they all equivalent?
Thanks!
- Greg
On May 11, 2007, at 11:33 PM, Andrey Borzenkov wrote:
> 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
>
>
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-05-12 17:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-11 19:44 Question regarding hotplug/udev + USB key Greg
2007-05-12 3:33 ` Andrey Borzenkov
2007-05-12 17:28 ` Greg
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).