Tag Info

New answers tagged


That has nothing to do with cat, pipes or buffering. Your "problem" is upstreams, at the terminal device. If every character you enter at the keyboard in the terminal was available for reading by your application immediately and cat, then would you enter aBackspacebReturn, your application would read a then ^? then b then ^M, which is not what you want and ...


follow this loop: while((ch=getchar())!=EOF) { write(p[1],&ch,1); } with: char carriageReturn = 0x0D; write( p[1], &carriageReturn, 1 );

Top 50 recent answers are included