Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!uwmcsd1!marque!uunet!super!rminnich From: rminnich@super.ORG (Ronald G Minnich) Newsgroups: comp.unix.wizards Subject: Re: How can I read keyboard without stopping Keywords: curses keyboard Message-ID: <669@super.ORG> Date: 29 Aug 88 17:52:08 GMT References: <813@ms3.UUCP> <1246@mcgill-vision.UUCP> <1988Aug15.130550.8571@ateng.uucp> <1267@ficc.UUCP> Sender: uucp@super.ORG Reply-To: rminnich@metropolis.UUCP (Ronald G Minnich) Organization: Supercomputing Research Center, Lanham, MD Lines: 18 In article <1267@ficc.UUCP> peter@ficc.UUCP (Peter da Silva) writes: >I believe that once upon a time on some system a stat() on a pipe would >return the number of characters in a pipe. Wouldn't it make sense to >have stat() on a terminal device return the number of characters available? You would think so, wouldn't you. On most of the systems i have tried it on it always returns 0 on ttys. That seems quite wrong to me, but there you are. 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. 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. And then you had to try to read 1 byte to get the rest of the kernel to realize you really WERE at EOF. Annoying. So many other OSs have a way of just TELLING you you are at EOF with a simple function call. There are funny little holes in the Unix filesystem even now ... ron