Listing devices using udisks2

David Zeuthen zeuthen at gmail.com
Mon May 14 14:01:19 PDT 2012


Hi,

On Mon, May 14, 2012 at 4:54 PM, Anant Kamath <kamathanant at gmail.com> wrote:
> Hi,
>
> I'm using udisks 1.97
>
> Since the EnumarateDevices DBus method is not available in udisks2, is the
> org.freedesktop.DBus.ObjectManager.GetManagedObjects method the best way to
> list drives using udisks2 ?

The best way is to use libudisks2 (LGPLv2), see

http://udisks.freedesktop.org/docs/latest/

which is accessible from C/C++ and any language supporting
GObjectIntrospection. If that is not an option, the next best choice
is to use GDBusObjectManagerClient, see

http://developer.gnome.org/gio/unstable/GDBusObjectManagerClient.html

or any other D-Bus ObjectManager implementation. If you don't have a
D-Bus ObjectManager implementation available, you can (relatively)
easily write one yourself, see

http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager

Also, you probably want to check out the udisks(8) man page, see

http://udisks.freedesktop.org/docs/latest/udisks.8.html

which has sections on API/ABI stability and whether you should be
using udisks at all.

Thanks,
David


More information about the devkit-devel mailing list