From: sundar sundar Date: 2013-03-29T03:49:12+09:00 Subject: Find usb properties/details using ruby-dbus and udisk I am doing project in which i need to detect all available usb drives and its info. Mainly i am interested in USB device (flash drive and external hard disk), mount point, uuid, total size, available space, label, and is the usb mounted or not. I thought ruby-dbus would be better to go with udisk. So installed with out an error. However i am unable to proceed further. I need to use this on linux. Here is the sample code #!/usr/bin/env ruby require 'rubygems' require 'dbus' bus = DBus::SystemBus.instance rb_service = bus.service("org.freedesktop.UDisks") rb_udisk = rb_service.object("/org/freedesktop/UDisks") rb_udisk.introspect rb_udisk_iface = rb_udisk["org.freedesktop.UDisks.Device"] puts rb_udisk_iface.DeviceIsRemovable However i get this error undefined method `DeviceIsRemovable' for nil:NilClass (NoMethodError) which i don't understand. Could some one help me on this? Useful links:- ruby-usb https://github.com/mvidner/ruby-dbus/blob/master/doc/Tutorial.md udisk http://udisks.freedesktop.org/docs/1.0.5/Device.html#Device:DeviceFile python and udisk http://mindbending.org/en/python-and-udisks-part-5 http://stackoverflow.com/questions/5067005/python-udisks-enumerating-device-information Any help is appreciated. -- Posted via http://www.ruby-forum.com/.