Date: Sun, 10 Apr 1994 19:33:18 -0700 From: drupp AT cs DOT washington DOT edu (Douglas Rupp) To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Strange behavior of _setmode (and setmode) I want to set STDOUT to raw mode, but leave STDIN in cooked mode but I can't, WHY? Consider the following program: #include main () { char buf[10]; int r; r = read(0,buf,10); printf("r=%d\n", r); _setmode(1, O_BINARY); r = read(0,buf,10); _setmode(1, O_TEXT); printf("r=%d\n", r); } If is input, the first read returns immediately with 1 character read (r=1). The second read will not return until 10 more keys are pressed, but still reports r=1. And I'm not setting the mode for STDIN, but only STDOUT. What's going on? Doug Rupp