Scanning stdin with no pause
Barry Gold
lcc.barry at UCLA-LOCUS.ARPA
Fri Dec 21 05:08:13 AEST 1984
May I suggest:
A. ioctl(fildes,FIONREAD, &count) which will tell you whether there are
any characters available from the file.
B. If you're using stdio, look in the buffer--the format of the stdio
FILE construct is published.
C. Run in cbreak mode and make the character you want to spot (I assume
it's one specific character you're interested in) into an interrupt character
(INT or QUIT) which you can then catch.
If you really want never to hang on that input stream, you'd better not use
stdio.
barry
More information about the Comp.unix.wizards
mailing list