Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site bnrmtv.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!sun!amdahl!bnrmtv!connery From: connery@bnrmtv.UUCP (Glenn Connery) Newsgroups: net.micro.pc Subject: How to tell if stdout is console Message-ID: <299@bnrmtv.UUCP> Date: Sat, 5-Apr-86 16:03:05 EST Article-I.D.: bnrmtv.299 Posted: Sat Apr 5 16:03:05 1986 Date-Received: Wed, 9-Apr-86 08:02:53 EST Distribution: net Organization: Bell Northern Research, Mtn. View, CA Lines: 14 ... In writing a number of utilities it has become desirable to be able to tell automatically if stdout has been redirected or not. For example in writing a directory lister which uses color through the BIOS it should automatically go back to normal DOS I/O if the device is not the console. I can do this through fstat or isatty in MSC 3.0 if the redirected device is a file and not a device, but I can't tell if the user has redirected stdout to the printer or another device. Any ideas? -- Glenn Connery, Bell Northern Research, Mountain View, CA {hplabs,amdahl,3comvax}!bnrmtv!connery