From: Hans-Bernhard B. <br...@ph...> - 2004-02-18 10:41:58
|
On Wed, 18 Feb 2004, Petr Mikulik wrote: > And a demo for Java? I have the (very crude) beginnings of a gpjava GUI interface. Interfacing the gnuplot process via a pair of pipes works, but that's about all it does. > *** > > Well, ad to the above problem with fifo in Octave -- why the following in > bash does not work? > > bash$ mkfifo cau > bash$ tail -f cau > > and in another xterm: > > gnuplot> set print "cau" > gnuplot> print "hello" > > Only sometimes the text appears in the "tail", but always it gets flushed > after "set print" (closing print file) or quitting gnuplot -- and why it > works in the C demo without closing "set print"? This may well be a problem of buffering. FIFOs are fully buffered by default, I think, whereas stderr, the default 'set print' output channel, is always completely unbuffered by C standard requirements. I.e. it should help to explicitly setbuf() the channel 'set print' opened to unbuffered. -- Hans-Bernhard Broeker (br...@ph...) Even if all the snow were burnt, ashes would remain. |