[comp.unix.questions] How does a C program know its input is being redirected?

mpyoung@portia.Stanford.EDU (M. Pinghua Young) (08/16/90)

I am writing a program that prompts users for various inputs.  However,
the user can also put the input in a file and pipe it to my program, or
use input redirection "<".  In this case I don't want the program to
prompt anything.  Can anyone tell me how to achieve that?  Please send
me e-mails.  Thank!

-- 
|   M. Pinghua Young               |    Confucius Said:                 |
|   pinghua@suwatson.bitnet        |        "Life Begins at 30"         |
|   mpyoung@portia.stanford.edu    |               But He Died At 29.   |