From: "ara.t.howard" Date: 2008-06-23T23:34:42+09:00 Subject: Re: Timeout when reading from a pipe On Jun 23, 2008, at 8:30 AM, Me Me wrote: > Hi, > I would like to launch a process (external executable) and raise an > exception if I cannot read any output from it on the stdout. > Is that possible? > > Thanks in advance > > def execute_mencoder(command) > IO.popen(command) do |pipe| > pipe.each("\r") do |line| > puts line > end > end > raise MediaFormatException if $?.exitstatus != 0 > end if you are windows no, otherwise yes. ri Timeout if you are on windows you'll want the systemu gem gem install systemu regards. a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama