Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.unix.programmer > #1202

Re: How to automatically flush stdout when a read from stdin occurs.

From Eric Sosman <esosman@ieee-dot-org.invalid>
Newsgroups comp.unix.programmer
Subject Re: How to automatically flush stdout when a read from stdin occurs.
Date 2011-09-02 20:43 -0400
Organization A noiseless patient Spider
Message-ID <j3rt6v$8rb$1@dont-email.me> (permalink)
References <500542b0-0d1d-4f96-9c17-2d77aacfd1b9@k29g2000yqf.googlegroups.com>

Show all headers | View raw


On 9/2/2011 5:20 AM, tm wrote:
> The standard behaviour of stdin and stdout is (when a program is
> started from a shell window):
>
>    Whenever I read from stdin a fflush(stdout) is automatically done,
>    before data is read from stdin. This allows nice interactive
>    behaviour.
>
> But when I connect to the same program via two pipes no such
> flushing occurs.
>
[...]

     Have you considered using a pty instead of a pair of pipes?

-- 
Eric Sosman
esosman@ieee-dot-org.invalid

Back to comp.unix.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to automatically flush stdout when a read from stdin occurs. tm <thomas.mertes@gmx.at> - 2011-09-02 02:20 -0700
  Re: How to automatically flush stdout when a read from stdin occurs. Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-09-02 13:50 +0100
    Re: How to automatically flush stdout when a read from stdin occurs. tm <thomas.mertes@gmx.at> - 2011-09-03 02:10 -0700
      Re: How to automatically flush stdout when a read from stdin occurs. Nobody <nobody@nowhere.com> - 2011-09-03 13:05 +0100
  Re: How to automatically flush stdout when a read from stdin occurs. Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-02 20:43 -0400
  Re: How to automatically flush stdout when a read from stdin occurs. gordonb.j3p91@burditt.org (Gordon Burditt) - 2011-09-02 23:56 -0500
    Re: How to automatically flush stdout when a read from stdin occurs. Nobody <nobody@nowhere.com> - 2011-09-03 09:08 +0100

csiph-web