Daniel Berger wrote: >> Is there a (non-hackish) way to get the error code from > Open3.popen()? >> The only way I seem to be able to do it currently is by appending > "echo >> $?" to the command, and parsing it out of stdout. $?.exitstatus > contains >> some random value. > > The normal way of getting an error out of Open3.popen3 is to check the > STDERR handle: > > fin, fout, ferr = Open3.popen3("ls") > error = ferr.gets > if error > puts "Error: " + error.to_s # There was an error > end I know of at least one programm using stderr for output even when execution was successfull! -- Martin Kaletsch