Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!usc!apple!bionet!ames!pacbell!att!ihlpl!knudsen From: knudsen@ihlpl.ATT.COM (Knudsen) Newsgroups: comp.lang.c Subject: Does NEWLINE always flush stdio buffer? Keywords: stdio printf I/O Message-ID: <11012@ihlpl.ATT.COM> Date: 29 Jun 89 19:05:15 GMT Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 18 I'd always understood that printf'ing any string ending in '\n' (newline) would flush the I/O buffer. However, I've found that this will not always flush if stdout has been redirected to a pipe. Possibly the failure is related to whether or not the byte preceding the newline is a printable ASCII character or not. I know about fflush(), which always works, but it can be a pain to call it in some cases. Does anyone know the "official" rules of the traditional stdio library? (Not the ANSII standard; I'm dealing with an older system). Thanks, mike k -- Mike Knudsen Bell Labs(AT&T) att!ihlpl!knudsen knudsen@ihlpl.att.com Round and round the while() loop goes; "Whether it stops," Turing says, "no one knows!" Shotguns -- just say PULL!