How do you tell if stdin/stdout is a terminal?

Yuval Kfir kfir at bimacs.BITNET
Mon Aug 6 04:20:29 AEST 1990


In article <12210 at hydra.gatech.EDU> gg10 at prism.gatech.EDU (GALLOWAY) writes:
(stuff deleted)
>It would also be nice, if the output of "foo" was no ASCII to display a message
>like "foo: output must not be terminal".  Again, so the novice user doesn't
>get blown away be several screenfulls of garbarge.  It seems most people like
>to figure out how an unknown program works by just typing its name and waiting
>for the old familar "usage: foo [ options ] arguments" line to pop up.

I seem to remember a function called isatty(stdin). I am not sure it is
standard. I hope this helps.

---------------------------------------------------------------------------
Yuval Kfir              kfir at bimacs.bitnet
                        kfir at bimacs.biu.ac.il

"If you can lead it to water and force it to drink then it isn't a horse."
--
---------------------------------------------------------------------------
Yuval Kfir              kfir at bimacs.bitnet
                        kfir at bimacs.biu.ac.il

"If you can lead it to water and force it to drink then it isn't a horse."



More information about the Comp.lang.c mailing list