How do I detect usb drive insertion in Linux?

后端 未结 1 1860
死守一世寂寞
死守一世寂寞 2020-12-20 22:57

I\'ve written an application for an embedded linux project, and I want my application to display a particular menu when the user inserts a USB drive. I\'m programming the a

1条回答
  •  渐次进展
    2020-12-20 23:35

    The section "libudev - Monitoring Interface" of this document http://www.signal11.us/oss/udev/ should get you started.
    Instead of a while(1) loop and a sleep, just make a function with that stuff and then set up a periodic Qt timer to call it every half second or whatever.

    0 讨论(0)
提交回复
热议问题