Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uunet!kddlab!titcca!wnoc-tyo-news!astemgw!choshi!frf!yang From: yang@nff.ncl.omron.co.jp (YANG Liqun) Newsgroups: comp.lang.c Subject: Re: It's unexplainable... Message-ID: Date: 1 Feb 91 01:45:38 GMT Sender: news@frf.omron.co.jp Organization: OMRON Corp., Kyoto, Japan Lines: 26 In profesor@wpi.WPI.EDU (Matthew E Cross)'s arctile he writes: >In article peterj@swanee.ee.uwa.oz.au (Peter Jones) writes: >>>In <1991Jan30.203605.14481@bronze.ucs.indiana.edu> >> speelmo@bronze.ucs.indiana.edu (Lance Speelmon - UCS) writes: >> ... >>>Would anyone please explain to me why my output is not what I am expecting... >> There are two processes running here, one is the "foo" program and the >>other is the "date" program. It will depend on the scheduling what actually >>happens - I guess. It would need "foo" to either flush its output buffer >>or to do an input or to write to "stderr" (& not be buffered). >No,no, no. Well, OK, ... >Also, the "date" program prints a newline before it prints the date. Yes, "date" does print a newline. But if it did not print a newline what would be ? Suppose system calls a command does not print a newline. I think the result will be the same. The key point here is that a process exits it will automatically close all the files opened and "close" will flush the buffer. Yang -- ; Li-qun Yang OMRON Computer Technology R&D lab ; yang@nff.ncl.omron.co.jp tel: 075-951-5111 fax: 075-956-7403