From: Jim Freeze Date: 2002-01-10T06:27:25+09:00 Subject: IO.popen not the same as Open3.popen3 ?? Hi: I can't seem to get Open3.popen3 to work the same as IO.popen, ie, I can't get it to accept a command with commandline arguments. Here is the code: --tester #! /usr/local/bin/ruby require 'open3' puts "-------- IO.popen() ------------" puts "`../bsimtran rulefile type in out`" sout = IO.popen("../bsimtran rulefile type in out", "w+") sout.each_line { |line| puts line } sout.close puts "-------- Open3.popen3 ------------" puts "`../bsimtran rulefile type in out`" sin, sout, serr = Open3.popen3("../bsimtran rulefile type in out", "w+") puts " -- stdout -- " sout.each_line { |line| puts line } puts " -- stderr -- " serr.each_line { |line| puts line } sin.close_write sout.close serr.close -- output of tester -------- IO.popen() ------------ `../bsimtran rulefile type in out` Input section for type is not found in the rule file. -------- Open3.popen3 ------------ `../bsimtran rulefile type in out` -- stdout -- -- stderr -- /usr/local/lib/ruby/1.6/open3.rb:33:in `exec': No such file or directory - "../bsimtran rulefile type in out" (Errno::ENOENT) from /usr/local/lib/ruby/1.6/open3.rb:33:in `popen3' from /usr/local/lib/ruby/1.6/open3.rb:21:in `fork' from /usr/local/lib/ruby/1.6/open3.rb:21:in `popen3' from /usr/local/lib/ruby/1.6/open3.rb:21:in `fork' from /usr/local/lib/ruby/1.6/open3.rb:21:in `popen3' from ./tester:28 Can anyone see if I am doing something wrong? Thanks -- Jim Freeze Today is a fine day for Ruby programming. www.freeze.org