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
Chip,
Why not simply print out the _iob[] array first with no re-direction
and then with re-directing stdin? That'd tell you if anything changed anyway.