Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!orion.oac.uci.edu!echarne From: echarne@orion.oac.uci.edu (Eli B. Charne) Newsgroups: comp.unix.questions Subject: Re: How to find out if stdout is piped? Message-ID: <25D902CF.20654@orion.oac.uci.edu> Date: 14 Feb 90 07:03:43 GMT References: <7638@tank.uchicago.edu> Organization: University of California, Irvine Lines: 21 phd_ivo@gsbacd.uchicago.edu writes: >In Mach (a BSD 4.3 clone), is there an easy way to >find out if stdout is hooked to a pipe, or redirected >into a file? Yes. Use the library routine isatty() isatty(filedes) Isatty returns 1 if filedes is associated with a terminal device, 0 otherwise. -Eli -- -------- Eli B. Charne INTERNET: echarne@ORION.OAC.UCI.EDU BITNET: echarne@UCI.BITNET