Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!rutgers!psuvax1!psuvm!barilvm!bimacs!kfir From: kfir@bimacs.BITNET (Yuval Kfir) Newsgroups: comp.lang.c Subject: Re: How do you tell if stdin/stdout is a terminal? Keywords: stdin/stdout, unix, C, redirected I/O Message-ID: <2072@bimacs.BITNET> Date: 5 Aug 90 18:20:29 GMT References: <12210@hydra.gatech.EDU> Reply-To: kfir@bimacs.biu.ac.il.UUCP (Yuval Kfir) Organization: Bar-Ilan University, Israel. Lines: 22 In article <12210@hydra.gatech.EDU> gg10@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@bimacs.bitnet kfir@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@bimacs.bitnet kfir@bimacs.biu.ac.il "If you can lead it to water and force it to drink then it isn't a horse."