5

I am using Python 2.7 with pyobjc on Lion and NSNotification center to monitor any inserted USB volumes. This works fine.

I've also got some ideas how to get a device's serial number, but these involve just parsing all the USB devices. I'd like to specifically query the inserted device only (the one creating the notification) rather than checking the entire USB device list.

How can this be accomplished? The NSNotification object passed to my handler function doesn't have that kind of information and I've not been able to find any information on doing the above with the information provided by the NSNotification object.

I've tried DBus (as I do on Linux) but I've not had much luck getting it to work reliably on OSX.

Svenito
  • 510
  • 4
  • 6
  • What do you mean by "USB volume serial"? Do you mean the USB device's serial number string as reported by USB Prober, or do you mean something specific to a particular partition or filesystem on that device? Do you care about handling Firewire or Thunderbolt storage devices, or are you looking for a very specific device, like a dongle? – user57368 Apr 05 '13 at 03:08
  • I am looking for the Device's serial number as I mentioned in the body of the question. I don't care for FW or TB, just USB, specifically any storage device. I just wanted to know if there's a better way to get the inserted device's details instead of checking all the connected devices. – Svenito Apr 05 '13 at 10:54

0 Answers0