I'm having some problems using spawn on Windows with Ruby 1.9.3. I want
to spawn a long running background process and read the output from it.
If I use :
r_out, w_out = IO.pipe
spawn('dir', [:out,:err] => w_out)
I can get the output from r_out.
However, if I use a test program :
spawn('ruby test.rb', [:out,:err] => w_out)
I get no output in the command window, or from r_out.
If I use :
spawn('start ruby test.rb', [:out,:err] => w_out)
I see output in the command window, but can't access it using r_out.
Presumably because it's now running as a child process of a child
process.
test.rb just does :
puts "running test.rb"
while true do
end
Any ideas ?
···
--
Posted via http://www.ruby-forum.com/.