From: greg Date: 2006-09-29T20:58:08+09:00 Subject: Re: how to determine if pipe is given Thanks for all the info guys. Here is what I came up with. This code seems invincible so far- it even works with & require 'thread' input = nil t = Thread.new() do input = STDIN.readlines end # do some stuff # parse some options while t.alive? old = input puts "thread running for 1 second" Kernel.sleep(1) if old == input if input puts "done collecting input" else puts "no input found on STDIN" end Kernel.sleep(1) t.kill break else puts "done collecting input" Kernel.sleep(1) end end puts input Greg