N
Nuralanur
-------------------------------1127493646
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Hello,
I would like to make Ruby run an external program - Maple - under Windows XP,
write something to it and then close it.
It would be nice to capture the output of that program, but that's not
obligatory, since I could make that program write a file for itself.
Following Hal Fulton's examples in "The Ruby Way", I tried two things without
success so far:
1.) Adapt
require "win32ole"
word = WIN32OLE.new "Word.Application"
word.visible = true
# ...
word.quit
2.) Adapt
require "open3"
filenames = %w[ file1 file2 this that another one_more ]
inp, out, err = Open3.popen3("xargs", "ls", "-l")
filenames.each { |f| inp.puts f } # Write to the process's stdin
inp.close # Close is necessary!
output = out.readlines # Read from its stdout
errout = err.readlines # Also read from its stderr
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Hello,
I would like to make Ruby run an external program - Maple - under Windows XP,
write something to it and then close it.
It would be nice to capture the output of that program, but that's not
obligatory, since I could make that program write a file for itself.
Following Hal Fulton's examples in "The Ruby Way", I tried two things without
success so far:
1.) Adapt
require "win32ole"
word = WIN32OLE.new "Word.Application"
word.visible = true
# ...
word.quit
2.) Adapt
require "open3"
filenames = %w[ file1 file2 this that another one_more ]
inp, out, err = Open3.popen3("xargs", "ls", "-l")
filenames.each { |f| inp.puts f } # Write to the process's stdin
inp.close # Close is necessary!
output = out.readlines # Read from its stdout
errout = err.readlines # Also read from its stderr