From: nagai@... Date: 2003-02-04T03:52:28+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: Mon, 3 Feb 2003 18:33:26 +0900 Message-ID: <3e3e32ea$1@epflnews.epfl.ch> > Here you go: Thank you for your report. Well, could you try the following test? 1. replace line 71--80 --------------------------------- begin ret = '' @to_cmd.write "print ''\n" while s = @from_cmd.gets break if s == "\n" ret << s end rescue Errno::EPIPE raise $!,'Lost gnuplot process (gnuplot argument error?)' end ----------------------------------------- | v ---------------------------------- begin ret = '' STDERR.print "before first write to the pipe\n" @to_cmd.write "print ''\n" STDERR.print "after first write to the pipe\n" while s = @from_cmd.gets break if s == "\n" ret << s end STDERR.print "succeed first read of the pipe\n" rescue Errno::EPIPE raise $!,'Lost gnuplot process (gnuplot argument error?)' end ----------------------------------------- 2. replace line 105 --------------------------------- @to_cmd.write cmd.chomp + "\n" ----------------------------------------- | v ---------------------------------- STDERR.print("before cmd write:",cmd.chomp.inspect,"\n") @to_cmd.write(cmd.chomp + "\n") STDERR.print("after cmd write\n") ----------------------------------------- 3. try the test script ----------------------------------------- require 'gnuplot.rb' # maybe need change the path of library STDERR.sync = true gp = GnuplotProcess.new('c:\program files\design\gnuplot\gp371w32\pgnuplot.exe') sleep 1 gp.cmd('plot sin(x)') sleep 5 ----------------------------------------- 4. please report the result of the test script -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)