|
From: Arnd B. <arn...@we...> - 2004-01-08 12:51:23
|
Hi,
On Wed, 7 Jan 2004, Ethan Merritt wrote:
> On Wednesday 07 January 2004 15:54, Ethan Merritt wrote:
> >
> > if we are going to
> > switch to unbuffered mode we should first make sure the
> > buffer is empty, or else store it elsewhere for later execution.
> >
> > I don't yet see a trivial way of doing this, but ...
>
> Trivial indeed. I was focused on the "or else", but in fact
> the first alternative is the easy one. The buffer is empty
> when the program starts, so I moved the call to setvbuf()
> out of X11_init() and put it right at the start of plot.c where
> the other I/O streams are being initialized.
>
> The X11 paste buffer is now working, and piping through awk
> now works too. I left the call to setvbuf() protected by
> #ifdef X11 but I doubt that it needs to be. Are any non-X11
> platforms also suffering lost characters in the input stream?
Well, for me the picture is slightly different:
a) on a PIV machine: no problems, pasting works, piping works
b) on my PIII (which I used to do the testing):
- pasting does not work the first time
- piping seems to work fine now
I haven't done thorough testing yet, but this seems
to improve!
Is the pasting problem related with what Hans just wrote/suggested
"I.e. don't switch off buffering halfway into the program, but
immediately after startup"?
((Speculating: maybe a "fast" machine is fast enough to switch off
buffering before something is written to the buffer?))
Many thanks,
Arnd
|