开发者

Can Ruby tell when a USB memory stick is plugged into a USB port on Linux?

开发者 https://www.devze.com 2022-12-09 02:12 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消