#C question–redirection
28-Aug-88 02:45:10
Sb: #8160-#C question–redirection
Fm: CHIP MATTSON 72017,442
To: Syndesis 76004,1763
I'd like the program to be able to tell if the user is redirecting the input
from a file, so it will only print the input prompts when input is from the
keyboard. The fscanf's I use for the input work OK with input from a file, but
the prompts aren't needed when the input is redirected.
In Lattice, I know that stdin and stdout are defined as (&_iob[0]) and
(&_iob[1]) respectively. _iob[] is an array of 'struct _iobuf' (type FILE). I
can't really tell what is different when redirection is used, but I think it
has something to do with the elements in the _iob[] array.
I need to talk with someone who knows how _iob[] changes when I/O is
redirected.
Thanks,
Chip Mattson
72017,442