Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!sundc!hadron!jsdy From: jsdy@hadron.UUCP (Joseph S. D. Yao) Newsgroups: net.lang.c,net.unix Subject: Re: C I/O Question Message-ID: <503@hadron.UUCP> Date: Thu, 31-Jul-86 01:13:30 EDT Article-I.D.: hadron.503 Posted: Thu Jul 31 01:13:30 1986 Date-Received: Thu, 31-Jul-86 23:46:54 EDT References: <1222@inuxc.UUCP> Reply-To: jsdy@hadron.UUCP (Joseph S. D. Yao) Distribution: net Organization: Hadron, Inc., Fairfax, VA Lines: 17 Summary: Several ways Xref: mnetor net.lang.c:5508 net.unix:5074 In article <1222@inuxc.UUCP> lar@inuxc.UUCP (L Reid) writes: >Is there a way to input a character from stdin without requiring >the user to terminate it with a . Several ways. All involve doing an stty() or an ioctl() call (depending on which version of Unix you have, or which you feel more comfortable with -- starting from scratch, use ioctl() if you have it). The simplest and most general is to go into 'raw' mode. If you are ceertain you'll never use a pre-V7 machine, 'cbreak' mode might be better, depending on your intentions. If you have System V, you can also set a minimum number of chars before input returns, and/or a timeout. -- Joe Yao hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP} jsdy@hadron.COM (not yet domainised)