CompuServe Messages

C question–redirection

    28-Aug-88 02:43:04
Sb: #8275-C question–redirection
Fm: CHIP MATTSON 72017,442
To: Vic Wagner 76046,3004
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