From: Jean-Marc Beroud Date: 2001-04-24T16:09:55+09:00 Subject: [ruby-talk:14142] Re: threads and IO.popen questions Clemens Wyss wrote: > 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 Doesn't work for me. The value of $? is not set on both cases. This seems to be a bug. Example: $ rm test.gz $ ruby -e'f = IO.popen( "gzip -cd test.gz" ); puts "code = <#{$?}>"' test.gz: No such file or directory code = <> $ echo "hello" | gzip - > test.gz $ ruby -e'f = IO.popen( "gzip -cd test.gz" ); puts "code = <#{$?}>"' code = <> $ ruby -v ruby 1.6.3 (2001-03-19) [sparc-solaris2.7] Greets /jm