|
From: Hans-Bernhard B. <HBB...@t-...> - 2008-03-24 17:33:15
|
Tait wrote: > I can tell Perl to autoflush, but I still have the > problem that Perl is too fast for pgnuplot. Is there any way for the data > provider (the thing dumping into the pipe) to know when pgnuplot/gnuplot > is ready for more input? I have no idea how Perl might do this. On the C side of things, what would be needed is blocking I/O. In short, the program calling pgnuplot would have to *wait* for pgnuplot. The low-level pipe functions in Win32, CreatePipe() used with ReadFile()/WriteFile(), claim to use blocking I/O, whereas the top-level <stdio.h> function _popen() apparently fails to block. The mid-range functions _pipe()/_read()/_write() claim they block, too. So the behaviour of scripting tools like Perl would depend on the way they run their pipes. >> The wgnuplot_pipes.exe is entirely different from the pgnuplot >> It allows that >> plot '< awk -f awkscript.awk' > > Is there a reason why the wgnuplot_pipes behavior is not simply the > default in wgnuplot.exe? To support opening pipes, wgnuplot_pipes keeps an open console. Among other things, this means that if you start it from a cmd.exe session, you don't get the prompt back until wgnuplot_pipes ends. |