Re: Capture console app output into texview?



On Sat, Nov 21, 2009 at 09:39:49AM +0100, Till Harbaum / Lists wrote:
thanks again for that hint. Unfortunately adding 
       /* switch to line buffered mode */
      if(setvbuf(fh, NULL, _IOLBF, 0))
              perror("setvbuf(_IOLBF)");

to the program posted by Dov doesn't change anything.
Are there limitations on changing the buffer mode? E.g.
only the transmitter side can do that?

The buffering is a feature of FILE* streams and is done in libc on both
sides.  So you effectively get the larger of the two buffers set by both
sides on the reading side (ordering the sizes none < line < full).

If the writer only sends the data to the pipe in full blocks there's
nothing you can with it on the reading side.

At least that's how I understand it.

Yeti




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]