Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!bonnie!akgua!mcnc!decvax!genrad!mit-eddie!godot!harvard!seismo!brl-tgr!tgr!kermit%okstate.csnet@CSNET-RELAY.ARPA From: Gregg WonderlyNewsgroups: net.unix-wizards Subject: Scanning stdin with no pause Message-ID: <6674@brl-tgr.ARPA> Date: Thu, 20-Dec-84 03:26:43 EST Article-I.D.: brl-tgr.6674 Posted: Thu Dec 20 03:26:43 1984 Date-Received: Sun, 23-Dec-84 01:18:50 EST Sender: news@brl-tgr.ARPA Organization: Ballistic Research Lab Lines: 24 [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@csnet-relay.arpa