Detecting console output

Dave Smith dave at thesmithfam.org
Fri Feb 19 19:59:38 MST 2010


Chris wrote:
> On Fri, Feb 19, 2010 at 5:51 PM, Dave Smith <dave at thesmithfam.org> wrote:
>
>   
>> How can I tell, in Linux in C, whether stdout and stderr are redirected
>> to a file vs. an interactive shell?
>>     
>
>
> isatty(fileno(stdout))
>   

Nailed it! Chris, you are the man!

--Dave



More information about the PLUG mailing list