Scanning stdin with no pause

Gregg Wonderly kermit%okstate.csnet at CSNET-RELAY.ARPA
Thu Dec 20 18:26:43 AEST 1984


[munch...munch...munch...]

    I am working with V7 UN*X.  I need a way to scan the standard input
stream for a character, but not wait.  If I set to cbreak mode, the
machine still waits for at least one character.  Looking at stdio.h
gave me no clues as it seems that the routine _filbuf() is called when
no characters are available, and this is where the system hangs.  I
am looking for a more or less portable solution if possible.  Also,
I almost forgot.  I need to put the character back on to stdin or 
only look at stdin and not take the character from the buffer.  This
appears more than trivial, so any help would be appreciated

Thanks in advance...

Gregg Wonderly
Department of Computing and Information Sciences
Oklahoma State University

          1                 ...!ihnp4!umn-cs!isucs1!\
         /|\         UUCP:     ...!ucbvax!mtxinu!ea! > okstate!kermit
         | |                ...!convex!ctvax!uokvax!/
   _____//|\\_____ 
  |_|_|_||_||_|_|_|
  |_|_|_|||||_|_|_|  ARPA:  kermit%okstate.csnet at csnet-relay.arpa  



More information about the Comp.unix.wizards mailing list