Path: utzoo!attcan!uunet!convex!killer!ames!mailrus!iuvax!silver!creps
From: creps@silver.bacs.indiana.edu (Steve Creps)
Newsgroups: comp.sys.ibm.pc
Subject: Re: How to determine stdin/out redirection
Message-ID: <2339@silver.bacs.indiana.edu>
Date: 26 Sep 88 16:58:04 GMT
References: <9465@cup.portal.com>
Reply-To: creps@silver.UUCP (Steve Creps)
Organization: IU CS Dept
Lines: 15

In article <9465@cup.portal.com> Steve_R_Calwas@cup.portal.com writes:
>Is there a way for an application program to determine whether or not its
>standard input and/or standard output are being redirected?

   Try
	if (!isatty(fileno(stdin))) {
		/* stdin is being redirected */
	}
and similarly for stdout. That's assuming you're using C.

-	-	-	-	-	-	-	-	-	-
Steve Creps, Indiana University, Bloomington, home of the "Hoosiers"
	creps@silver.bacs.indiana.edu (192.12.206.2)
	{inuxc,rutgers,pyramid,pur-ee}!iuvax!silver!creps
	creps@iubacs.bitnet (forwarded)