From: Ralf Date: 2003-02-04T22:53:21+09:00 Subject: Re: tkgnuplot problem: fork() on win (popen3 for windows?) nagai@ai.kyutech.ac.jp wrote: > Hi, > > From: nobu.nokada@softhome.net >>I guess qoutes surround command path are necessary. >> gp = GnuplotProcess.new('"c:\program files\design\gnuplot\gp371w32\pgnuplot.exe"') >>Or, this seems better, put quotes in command for win32_popen4. >> def _win32_open_process(*cmd) >> require 'win32_popen' >> >>+ cmd.collect! {|s| /\s/ =~ s ? %{"#{s}"} : s} >> IO.win32_popen4(cmd.join(' ')) >> end > > How foolish I am! > Ralf, could you try the test script after applying Nobu's patch > and report the result ? BINGO! The gnuplot process is started and the print'' command sent. But ... the appears in the gnuplot window, and ... in gnuplot.rb:initalize begin ret = '' @to_cmd.write "print ''\n" while s = @from_cmd.gets # gets stuck here !!! break if s == "\n" # because never arrives. ret << s end rescue Errno::EPIPE raise $!,'Lost gnuplot process (gnuplot argument error?)' end So gnuplot maybe needs a parameter, so the window doesn't open, and the output goes from gnuplot to "stdout" ? We're close! Thanks, Ralf.