Useless Microoptimizations Site Admin
Joined: 09 Feb 2005 Posts: 114 Location: Boston, MA, USA
|
Posted: Wed Sep 14, 2005 5:54 pm |
|
|
cratimeout is a wrapper about commandlines. As the namesuggests, after a specified timeout the commandline will terminate.
Example:
cratime 5000 ssh foobared.host.com ls
|
will not wait longer that 5 seconds for the ssh command to complete.
Usage is very simple: the first argument is a timeout in milliseconds, all other arguments for the commandline to be executed.
cratime has been coded carefully to change the semantics of the called program as few as possible. In particular, it preserves signal behavior. SIGINT, SIGQUIT etc. sent to the program will make the whole commandline have the signal semantics as if the program was called directly.
For now, cratimeout is a simple C program without configure script. Download it from http://www.cons.org/cracauer/download/cratimeout.c
Please give feedback if you notice problems. If compilcation turns out nontrivial on common platforms I will make a proper package out oof cratime. |
|