Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!munnari.oz.au!uniwa!DIALix!metapro!bernie From: bernie@metapro.DIALix.oz.au (Bernd Felsche) Newsgroups: comp.unix.programmer Subject: Re: How to determine the destination of standard output? Message-ID: <1991Feb9.050616.17241@metapro.DIALix.oz.au> Date: 9 Feb 91 05:06:16 GMT References: <1991Feb6.204432.2850@cubmol.bio.columbia.edu> Organization: MetaPro Systems, Perth, Western Australia Lines: 18 In <1991Feb6.204432.2850@cubmol.bio.columbia.edu> ping@cubmol.bio.columbia.edu (Shiping Zhang) writes: >I'm not sure if this subject has be discussed before. I want to know >if there is a way to tell within a program where its standard output >goes. More specifically, if the output goes to the terminal screen, or >goes to a pipe, or is redirected into a disk file. Thanks for any info. Refer to fstat(2) for System V. This gives you inode info for a file descriptor. There is also isatty(3), which tells you if it is. -- _--_|\ Bernd Felsche #include / \ Metapro Systems, 328 Albany Highway, Victoria Park, Western Australia \_.--._/ Fax: +61 9 472 3337 Phone: +61 9 362 9355 TZ=WST-8 v E-Mail: bernie@metapro.DIALix.oz.au | bernie@DIALix.oz.au