Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-spam!ames!ucbcad!ucbvax!decvax!tektronix!teklds!copper!stevesu From: stevesu@copper.UUCP Newsgroups: comp.unix.wizards Subject: Re: reading from terminal Message-ID: <1123@copper.TEK.COM> Date: Sat, 13-Jun-87 17:57:17 EDT Article-I.D.: copper.1123 Posted: Sat Jun 13 17:57:17 1987 Date-Received: Sun, 14-Jun-87 18:37:21 EDT References: <7749@brl-adm.ARPA> Organization: Tektronix Inc., Beaverton, Or. Lines: 29 In article <7749@brl-adm.ARPA>, jfjr@mitre-bedford.arpa (Freedman) writes: > I need to read a character from the terminal without stopping a > program. I have done this successfully and simply on VMS using qio > with the proper flag but I am having problems doing it on Unix. > > I really must say that Unix documentation compared to > VMS doesn't measure up... As several people have already mentioned, ioctl(FIONREAD) and select() are fairly general and somewhat portable solutions under Unix. You might have mentioned the specific qio options you used-- some of us Unix wizards have ventured off into VMS and lived to tell about it. If you were doing true asynchronous I/O, by using qio (as opposed to qiow) and specifying an AST completion routine, you may find some equivalents on Unix; look at fcntl(2), if you have it, specifically the FNDELAY and FASYNC options. Beware that these facilities are newer, buggier, less portable, and harder to use than the more mature parts of Unix. I won't defend Unix documentation, but I'll throw in a potshot at VMS--I'd find its documentation a lot easier to use if it had an index that was at all usable. I have _n_e_v_e_r in my entire life looked up a topic in a VMS index and found what I was looking for, even when I knew that I'd read exactly what I was looking for once before. (Please, no Unix vs. VMS holy wars in response to this.) Steve Summit stevesu@copper.tek.com