Can Ruby tell when a USB memory stick is plugged into a USB port on Linux?
I'm working on a utility that will scan USB ports and mount any Mass Storage devices it finds. I 开发者_如何学JAVAcan poll for changes ( with a patched version of Ruby-USB ) but would much rather get a notification, or subscribe to some event.
Is there a way for Ruby to be tickled when a USB stick is inserted?
Check out ruby-dbus. There is also a tutorial for it as well.
精彩评论