On Sun, 2002-09-08 at 16:37, Erik de Castro Lopo wrote: > On Sun, 08 Sep 2002 16:22:55 +1000 > Lucas King <[EMAIL PROTECTED]> wrote:
> > Don does not go on to say how one makes a program think that it is > > "talking" to an interactive interface. > > > > does anyone know how to do this? in C preferrably. > > The only way I know of doing this is my setting the programm up to talk > to your own program via a pty (psuedo terminal). There is an example > of this in the late Richard Steven's book "Advanced Programming in a Unix > Environment". ptys and buffering are orthogonal. IIRC ptys by default are line buffered anyway. setbuf(stdout, NULL); should set the stdout buffer mode to _IONBF for you. (setvbuf is not as portable as setbuf). You MUST call this before performing any writes to stdout. Cheers, Rob
signature.asc
Description: This is a digitally signed message part
