From: Ralf Date: 2003-02-03T18:33:26+09:00 Subject: Re: tkgnuplot problem: fork() on win (popen3 for windows?) Here you go: Code: require 'gnuplot.rb' # maybe need change the path of library gp = GnuplotProcess.new('c:\program files\design\gnuplot\gp371w32\pgnuplot.exe') gp.cmd('plot sin(x)') sleep 5 Result: C:/Program Files/ruby/lib/ruby/1.6/gnuplot.rb:105:in `write': Invalid argument (Errno::EINVAL) from C:/Program Files/ruby/lib/ruby/1.6/gnuplot.rb:105:in `_send_cmd' from C:/Program Files/ruby/lib/ruby/1.6/gnuplot.rb:96:in `synchronize' from C:/Program Files/ruby/lib/ruby/1.6/gnuplot.rb:96:in `_send_cmd' from C:/Program Files/ruby/lib/ruby/1.6/gnuplot.rb:154:in `cmd' from C:\DOCUME~1\longwitz\LOCALS~1\Temp\rb13C.tmp:3 Completed(1) nagai@ai.kyutech.ac.jp wrote: > Hi, > > From: Ralf > Subject: Re: tkgnuplot problem: fork() on win (popen3 for windows?) > Date: Fri, 31 Jan 2003 23:25:17 +0900 > Message-ID: <3e3a3587$1@epflnews.epfl.ch> > >>nagai@ai.kyutech.ac.jp wrote: >> >>>Well, what happen when you give the gnuplot command path to 1st argument of >>>GnuplotProcess.new method ? >> >>same thing. >>Then I found this in our script: >> gp.terminal = 'x11 1' >>Smells like Unix to me ... well, commenting it out didn't help ... > > > When only require it, the part which include "gp.terminal = 'x11 1'" > must not be evaluated. > Did you execute "ruby gnuplot.rb"? > I want to know the result with all messages > of running the following script. > ------------------------------------------------------------ > require './gnuplot.rb' # maybe need change the path of library > gp = GnuplotProcess.new('c:\program files\design\gnuplot\gp371w32\pgnuplot.exe') > gp.cmd('plot sin(x)') > slesp 5 > ------------------------------------------------------------------------ > If you can check the running process list, > please check the exsistence of gnuplot process just after executing > the second line of the script. > The information of "When is the gnuplot process lost?" > gives me hints of the problem. > > # If the problem depends on win32_popen, > # I cannot fix the problem immediately. > # Because I must finish to write two papers in this five days. :-) > -- > Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) >