From: alaric AT abwillms DOT demon DOT co DOT uk (Alaric B. Williams) Newsgroups: comp.os.msdos.djgpp Subject: Re: Is stdout the console? Date: Sat, 01 Mar 1997 15:32:23 GMT Message-ID: <3317703f.1201057@news.demon.co.uk> References: <01IFXYQFJ23Q00I1MD AT cc DOT uab DOT es> <331703AC DOT 5552 AT rpi DOT edu> NNTP-Posting-Host: abwillms.demon.co.uk Lines: 29 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Fri, 28 Feb 1997 11:11:24 -0500, Brian Osman wrote: >Hmmm. Right now I can't think exactly what you'd look for, but I'm sure >you could figure it out somehow with stat(). I was thinking you could >try opening it for read only, but I've heard from some people that >(at least on some systems) stdout and stdin can both be opened the >wrong way... :) Try stat() and checking some of the different flags >for file types, and see what you get when it is/isn't redirected. (Or, >write soemthing and look in the video memory for it. Ouch, that's an >evil suggestion.) Whatever's wrong with "isatty(1)"? It returns 1 if the standard output handler is a terminal, or zero otherwise. It exists under DJGPP, and the info file doesn't say it doesn't work, so I guess it probably does! ABW -- "Simply drag your mother in law's cellphone number from the Address Book to the Laser Satellite icon, and the Targeting Wizard will locate her. Then follow the onscreen prompts for gigawattage and dispersion pattern..." (Windows for Early Warning and Defence User's manual P385) Alaric B. Williams Internet : alaric AT abwillms DOT demon DOT co DOT uk Hello :-)