How to implement timeout on vista

Hi all,

I am sorry if this post is duplicated.

Here is what I try to do: get input from terminal/console. If waiting
for 3 seconds and no input is given, then stop this process and print
out a message of ‘Timeout!!!’

I tried ‘timeout’ from the library but it doesn’t work.I wonder how I
implement timeout process on vista.

Thank you very much in advance,

Li

On Oct 28, 2008, at 7:23 AM, Li Chen wrote:

implement timeout process on vista.

Thank you very much in advance,

Li

Posted via http://www.ruby-forum.com/.

gem install terminator

http://codeforpeople.com/lib/ruby/terminator/terminator-0.4.2/README

cheers.

a @ http://codeforpeople.com/

Ara Howard wrote:

gem install terminator

http://codeforpeople.com/lib/ruby/terminator/terminator-0.4.2/README

cheers.

a @ http://codeforpeople.com/

Thanks.

I try terminator on my PC with Vista. I don’t think it works. If I put
‘input=gets’ and without giving the input it will hang there for ever.

Li

#################1
C:\Users\Alex>irb
irb(main):001:0> require ‘terminator’
=> true
irb(main):002:0> Terminator.terminate 1 do
irb(main):003:1* sleep 4 rescue puts ‘timeout’
irb(main):004:1> end
=> 2456

################ I have to use Ctrl+break to stop the script after 2 min
were passed.

C:\Users\Alex>irb
irb(main):001:0> require ‘terminator’
=> true
irb(main):002:0> Terminator.terminate 1 do
irb(main):003:1* input=gets
irb(main):004:1> sleep 4 rescue puts ‘timeout’
irb(main):005:1> end
2 min pased
=> 2708