Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!cwjcc!hal!ncoast!allbery From: allbery@ncoast.ORG (Brandon S. Allbery) Newsgroups: comp.unix.wizards Subject: Re: stdout (was What "isatty"?) Message-ID: <13693@ncoast.ORG> Date: 3 Jun 89 18:12:01 GMT References: <19756@adm.BRL.MIL> <17796@mimsy.UUCP> <7509@bsu-cs.bsu.edu> Reply-To: allbery@ncoast.UUCP (Brandon S. Allbery) Followup-To: comp.unix.wizards Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 34 As quoted from <7509@bsu-cs.bsu.edu> by dhesi@bsu-cs.bsu.edu (Rahul Dhesi): +--------------- | In article <17796@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: | >As you can see by the `:-)' sign, Jimmy C. is kidding. But there is | >much truth in this. The C compiler should write to stdout, unless | >there is some overriding reason that it cannot... | | I can think of a moderately overriding reason that it should not. | Generalizing: | | Programs should write to stdout when their output would make sense | on a computer terminal, or when their output is likely to be | redirected elsewhere and used properly. Programs that seek are an | exception. | | Unfortunately, cc's output will put most terminals in a funny state, | and cc is often invoked interactively. +--------------- By that argument, "cat /bin/sh > /dev/tty" should refuse to work because it's writing a binary file to the terminal. Foo. "...likely to be redirected elsewhere": if cc had been written correctly, people using it would know that it outputs a binary file and would therefore be "likely to be redirected elsewhere." (Actually, if "cc" had been written correctly, it would output assembly language, which is ASCII, so the point is moot.) ++Brandon -- Brandon S. Allbery, moderator of comp.sources.misc allbery@ncoast.org uunet!hal.cwru.edu!ncoast!allbery ncoast!allbery@hal.cwru.edu Send comp.sources.misc submissions to comp-sources-misc@ NCoast Public Access UN*X - (216) 781-6201, 300/1200/2400 baud, login: makeuser