Udev & Interacting With Devices

Hi,

I'm trying to work out how to work with udev in my programs. I understand that this works in conjunction with sysfs mounting devices in the tree dynamically.

More specifically, I want my program to find a USB Memory stick and then read/write data to it but I cannot find out any goo tutorials on how to do it except this brief intro here :

http://www.signal11.us/oss/udev/

And the udev API pages are not particularly helpful for a beginner.

1) What particularly puzzles me is how do I know what class a particular device is? e.g. what class is a memory stick? And where can I find out how other devices are classed?

2) Can I used the output from dmesg to determine what class my device is and how can I do that?

3) Are there any good tutorials or books on this particular subject?

Codebugs
I've not used it, but does this return the device type as a string? udev_device_get_devtype()

http://www.kernel.org/pub/linux/utils/kernel/hotplug/libudev/ch01.html

I'm not near a Linux box so I can't test it.
Topic archived. No new replies allowed.