I have an app which needs to know whether an USB thumb drive is connected to the system. I used udev to create a file in /tmp to signal the presence of the thumb drive, and the access() system call to check for the file existance. However, this is taking too long on my system, which is very time constrained. Is there a faster way for a process to be notified of the connection? |
Please accept an answer so the question/answer can be finished.