How do you get *unbuffered* pipeline I/O from sys commands

Richard Tobin richard at aiai.ed.ac.uk
Sat Feb 10 00:23:12 AEST 1990


In article <1320 at csisles.Bristol.AC.UK> mackeown at csisles.UUCP (W. Mackeown) writes:
>Does anyone know if it is possible to force SunOS v4.0.1 Unix on Sun 3/50's
>to do unbuffered pipeline I/O ?  What is wanted is a way to make system
>commands send their output through a pipe in unbuffered form, ie. a single
>character at a time. "stty +cbreak" obviously won't accomplish this.

If a program is using standard i/o to write to a pipe, then there's no
way to remove the buffering without modifying the program - the buffering
is done by the program, not by the operating system.

What you *can* do is use a pseudo-terminal instead of a pipe.  Then the
buffering will be the same as when the program is sending output to the
screen - typically a line at a time.  This may or may not be good enough.

You won't be able to arrange this from a standard shell, but you could
write a program that takes two commands and connects them through a pseudo-
terminal.

-- Richard
-- 
Richard Tobin,                       JANET: R.Tobin at uk.ac.ed             
AI Applications Institute,           ARPA:  R.Tobin%uk.ac.ed at nsfnet-relay.ac.uk
Edinburgh University.                UUCP:  ...!ukc!ed.ac.uk!R.Tobin



More information about the Comp.unix.questions mailing list