From: platt@coos.dartmouth.edu (The Crouton Man) Subject: bug in /dev/tty Date: 28 Jul 1992 06:05:05 GMT
ok, i am using 0.96cpl2 + autodetect + filefs.
shell: rc ( and bash for test )
it is my understanding that you should be able to open /dev/tty
in order to capture keyboard input even if the stdin is redirected
from a file or pipe. however, when i do the following:
cat foo | myprogram
and
fd = open("/dev/tty",O_RDONLY);
printf("fd: %d\n",fd);
i get
fd: 0
which should be stdin, and it is, but not the keyboard (tty).
should not i have a separate file descriptor from the stdin?
more importantly why don't i, and how do i open the keyboard (tty),
as opposed to stdin (which has been redirected from stdin).
any ideas?
croutons
croutons@dartmouth.edu