Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: How can I read keyboard without stopping Keywords: curses keyboard Message-ID: <13307@mimsy.UUCP> Date: 30 Aug 88 23:59:40 GMT References: <813@ms3.UUCP> <1246@mcgill-vision.UUCP> <669@super.ORG> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 25 >In article <1267@ficc.UUCP> peter@ficc.UUCP (Peter da Silva) writes: >>... Wouldn't it make sense to have stat() on a terminal device return >>the number of characters available? In article <669@super.ORG> rminnich@super.ORG (Ronald G Minnich) writes: >You would think so, wouldn't you. Perhaps. I doubt one could make much use of it, since it would change from moment to moment, as the user types. >Also, on most unix's you can't tell whether there are 0 bytes >to read because of an eof or 0 bytes cause nothing is there yet. False (except perhaps on SysV, where read on a non-blocking descriptor returns 0 instead of -1). >I haven't looked lately to see if such a thing has been added; on 4.2-like >systems you had to to shenanigans with select() and FIONREAD to determine >that you were at EOF. Again, false. The only odd thing about EOF on a terminal is that it is not `sticky', since it is (usually) caused by a human agent and not something reliable :-) . -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris