Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!bloom-beacon!world!jstone From: jstone@world.std.com (Jeffrey R Stone) Newsgroups: comp.os.msdos.programmer Subject: Re: How to detect redirection? Message-ID: <1990Aug8.030621.24021@world.std.com> Date: 8 Aug 90 03:06:21 GMT References: <1426@wet.UUCP> <1990Aug8.012021.19429@ucselx.sdsu.edu> Distribution: na Organization: The World @ Software Tool & Die Lines: 14 lai@math.sdsu.edu (Henry Lai ) writes: >In article <1426@wet.UUCP> naga@wet.UUCP (Peter Davidson) writes: [ question about how to detect that stdout has been redirected ] > isatty (fileno (stdout)) >will return zero if stdout has been redirected to a file. See the >reference to isatty in your run-time library reference. According to Turbo C's library reference, isatty() returns TRUE if it argument file pointer is a character devuce - A tty - not necessarily THE tty. -jeff-