From: nagai@... Date: 2003-01-29T21:52:24+09:00 Subject: Re: tkgnuplot problem: fork() on win (popen3 for windows?) Hi, From: Ralf Subject: Re: tkgnuplot problem: fork() on win (popen3 for windows?) Date: Wed, 29 Jan 2003 18:05:11 +0900 Message-ID: <3e379486$1@epflnews.epfl.ch> > Now I get this: > C:\Program Files\ruby\tkgnuplot\gnuplotP.rb:105:in `write': Invalid > argument (Errno::EINVAL) > from C:\Program Files\ruby\tkgnuplot\gnuplotP.rb:105:in `_send_cmd' > from C:\Program Files\ruby\tkgnuplot\gnuplotP.rb:96:in `synchronize' > from C:\Program Files\ruby\tkgnuplot\gnuplotP.rb:96:in `_send_cmd' > from C:\Program Files\ruby\tkgnuplot\gnuplotP.rb:154:in `cmd' > from C:\Program Files\ruby\tkgnuplot\gnuplotP.rb:184:in `set' > from C:\Program Files\ruby\tkgnuplot\gnuplotP.rb:88:in `method_missing' > from C:\Program Files\ruby\tkgnuplot\gnuplotP.rb:420 > from C:\Program Files\ruby\tkgnuplot\gnuplotP.rb:419:in `synchronize' > from C:\Program Files\ruby\tkgnuplot\gnuplotP.rb:419 > Completed(1) Hmm... It maybe fail to start gnuplot process. The test routine on gnuplot.rb is witten for X environment. Therefore, if gnuplot on windows does not support '-geometry' option, fail to create a gnuplot process on line 416 ( gp = GnuplotProcess.new('geometry'=>'500x200') ). Please try the following check on irb. irb(main):001:0> require './gnuplot.rb' irb(main):002:0> gp = GnuplotProcess.new irb(main):003:0> gp.cmd('plot sin(x)') If you get a graph of a sin wave, you are ready to use TkGnuplot.rb. But, it depends on win32_popen whether tkgnuplot.rb works collectry. If there is a buffering problem, tkgnuplot.rb may have been hunged up. # Original gnuplot.rb sets sync mode of subprocess's stdout to true # before exec 'gnuplot'. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)