This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
tcgetattr(0, &T) fails on redirection
- To: cygwin at sourceware dot cygnus dot com
- Subject: tcgetattr(0, &T) fails on redirection
- From: Keraba <keraba at yahoo dot com>
- Date: Tue, 2 Nov 1999 12:01:14 -0800 (PST)
The following code:
#include <sys/termios.h>
main()
{
struct termios T;
if (tcgetattr(0, &T) == 0)
printf("Succeeded\n");
else
printf("Failed\n");
}
works when I simply execute
./program
but fails when I run
./program < file
Is the standard input file descriptor not 0 in this case ?
If so, how do I find out what it is ?
Or perhaps one can't run tcgetattr on this file descriptor ?
If its impossible, how does one put standard input into
raw mode in this case ?
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com