jimmy@rlvd.UUCP (Jimmy Aitken) (01/14/85)
I am trying to detect uniquely when one of the following situations occurs in a C program. I have tried isatty(3) but cannot distinguish between a), b), and c) below. Any helpful pointers would be appreciated. a) The standard input has been re-directed in a foreground process b) The standard input has been re-directed in a background process c) No re-direction of standard input in a background process d) No re-direction of standard input in a foreground process
Ron Natalie <ron@BRL-TGR> (01/17/85)
Actually, you can't tell any of them. Isatty only tells you whether the file descriptor is a terminal or not, which has no correllation to whether input has been redirected. -Ron