Path: utzoo!attcan!uunet!nih-csl!lhc!ncifcrf!haven!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!wuarchive!emory!gatech!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!ruuinf!ruunsa!neviatar From: neviatar@ruunsa.fys.ruu.nl (Hadass Eviatar) Newsgroups: comp.os.os9 Subject: single character read revisited Keywords: read () Message-ID: <1739@ruunsa.fys.ruu.nl> Date: 7 Nov 90 12:18:43 GMT Organization: University of Utrecht, Dept. of Physics Lines: 40 Hiya netters, Turns out I was asking for help on the wrong problem. This is what actually happened: What I was trying to do is: while (FOREVER) { count = read (0, &buffer, 1); printf ("# = %d, char = %d\n", count, buffer); } It appeared that the print-out for the first character didn't occur until the second character was typed. I thought that this was caused by the buffering of read. When I changed the c-code to: while (FOREVER) { count = read (0, &buffer, 1); write (1, &buffer, 1); } It worked without any problem. Apparently, the buffering-problem is in printf, not in read. In any case, many thanks to all the people who took the trouble to give me excellent advice! hhhhhhhhhhhhh ==================================================================== Hadass Eviatar, Dept. of Molecular Biophysics, University of Utrecht Physically: Buys Ballot Laboratory, Princetonpl. 5, 3584 CC Utrecht Electronically: neviatar@ruunsa.fys.ruu.nl Acoustically: 030 - 531555/2839/2951 Always yield to temptation - Oscar Wilde. ====================================================================