Article View: net.micro.pc
Article #6160Re: How to tell if stdout is console
From: Bill Crews
Date: Wed, 09 Apr 1986 01:12
Date: Wed, 09 Apr 1986 01:12
22 lines
1556 bytes
1556 bytes
> 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
Bit 1 (i.e., mask = 0x0002) of the IOCTL word (interrupt 0x21, function
0x44) is labeled ISCOT in the DOS Technical Reference Manual, which means
that "this device is the console output". It would seem that this is the bit
you need to interrogate, but I don't know if MSC 3.0 has a library function
that passes it through.
--
- bc -
..!{seismo,topaz,gatech,nbires,ihnp4}!ut-sally!cyb-eng!bc (512) 835-2266
Technical Details
Message-ID:
<804@cyb-eng.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!princeton!orsvax1!pyrnj!caip!lll-crg!mordor!ut-sally!cyb-eng!bcReferences:
<299@bnrmtv.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!princeton!orsvax1!pyrnj!caip!lll-crg!mordor!ut-sally!cyb-eng!bc From: bc@cyb-eng.UUCP (Bill Crews) Newsgroups: net.micro.pc Subject: Re: How to tell if stdout is console Message-ID: <804@cyb-eng.UUCP> Date: Tue, 8-Apr-86 20:12:26 EST Article-I.D.: cyb-eng.804 Posted: Tue Apr 8 20:12:26 1986 Date-Received: Thu, 10-Apr-86 07:49:49 EST References: <299@bnrmtv.UUCP> Distribution: net Organization: Cyb Systems, Austin, TX Lines: 22