www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/28/19:38:59

From: billlanam AT california DOT com (Bill Lanam)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Is stdout the console?
Date: Fri, 28 Feb 1997 22:29:23 GMT
Message-ID: <33175592.4096526@seashell.california.com>
References: <01IFXYQFJ23Q00I1MD AT cc DOT uab DOT es>
NNTP-Posting-Host: 140.174.210.132
Lines: 21
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Fri, 28 Feb 1997 08:37:44 GMT, "X DOT PONS AT UAB DOT ES" <ILGES AT cc DOT uab DOT es> wrote:

>I need to know if stdout is the console, i.e., if it has not been
>redirected to a file through
>
>   MY_PROGRAM  > FILE
>
>In TC, I do it by checking the field "flag" of the FILE structute associated
>with stdout: if stdout is the console, this flag indicates _F_TERM.
>In DJGPP the FILE structure semms to be different and I cannot find this
>flag. In fact, if you know some other portable way to know if stdout is the
>console or a file it will also be useful to me.
>
>Thanks in advance!
>
>XP

The 'istty' function tells you whether or not you are using a char device like
CON:.

    Bill Lanam

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019