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?

asked 23 Apr '10, 09:26

metiu's gravatar image

metiu
111
accept rate: 0%

Please accept an answer so the question/answer can be finished.

(20 Apr '11, 13:42) rfelsburg ♦



Could you not write a script which greps dmesg for the signals when it connects?

link

answered 23 Apr '10, 22:54

XavierP's gravatar image

XavierP
1414
accept rate: 16%

You could use signals : SIGUSR1, or SIGUSR2.

link

answered 04 May '10, 18:39

npostavs's gravatar image

npostavs
963
accept rate: 42%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1
×1
×1

Asked: 23 Apr '10, 09:26

Seen: 753 times

Last updated: 20 Apr '11, 13:42

Related questions

powered by OSQA