🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #5854

Re: Sensing STDOUT redirection in C

#5854
From: John Allen on wsl
Date: Tue, 16 Apr 1991 15:36
13 lines
820 bytes
if (isatty(1))
	{
	// has been redirected
	}
else 
	{
	// has not been redirected
	}
-- 
People that don't know want to know from the people that do know and if the 
poeple that do know don't tell the people that don't know then the people
that don't know still won't know.
				   "Don't quote me on any issue whatsoever."
Technical Details
Message-ID: <753@wsl.ie>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!tcdcs!wsl!jja
References: <collinsa.671721083@p4.cs.man.ac.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!tcdcs!wsl!jja
From: jja@wsl.ie (John Allen on wsl)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Sensing STDOUT redirection in C
Keywords: STDOUT, Redirection, MSDOS
Message-ID: <753@wsl.ie>
Date: 16 Apr 91 15:36:34 GMT
References: <collinsa.671721083@p4.cs.man.ac.uk>
Organization: Workhorse Systems Limited, Dublin
Lines: 13