Can Ruby say when a USB drive is connected to the USB port on Linux?

I am working on a utility that scans USB ports and mounts any storage devices it finds. I can poll the changes (with a fixed version of Ruby-USB), but I would rather get a notification or subscribe to some event.

Is there a way to hack Ruby when a USB drive is inserted?

+3
source share
1 answer

Check ruby-dbus . There is also a tutorial for it.

0
source

Source: https://habr.com/ru/post/1720925/


All Articles