From: wys@... (Clemens Wyss) Date: 2001-04-24T14:11:25+09:00 Subject: [ruby-talk:14139] Re: threads and IO.popen questions Jean-Marc Beroud wrote in <3AE45AEC.A6144F96 @ubs.com>: > begin > IO.popen( "gzip -cd #{file}" ) > > rescue > # I don't see this message > $stderr.puts "ERROR: #{file}: #{$!}"; exit 1 > end > > Why does IO.popen not generate an exception (gzip fails)? > How can I test if gzip is successful or not? > the lobal variable $? contains the "exit code" of the last call: I.e.: output = IO.popen( "gzip -cd #{file}" ) if not($? == 0) then print ("Error #{output.read()}") end Clemens