Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!batcomputer!rpi!leah!emb978 From: emb978@leah.Albany.Edu (Eric M. Boehm) Newsgroups: comp.unix.questions Subject: Reading stdin in raw mode Keywords: stdin raw ioctl read Message-ID: <1713@leah.Albany.Edu> Date: 26 Mar 89 05:25:16 GMT Organization: The University at Albany, Computer Services Center Lines: 16 I am trying to read stdin in raw mode. I am sending the terminal enquire string (ESC Z) and trying to read the response. I must be in raw mode since the response string has no terminating newline. I can do this with getchar() but getchar() returns no error code if there is nothing to be read, it just keeps waiting for input. However, if I try to read stdin with read(2) in nonblocking mode, I am told there is nothing there (returns -1). My goal is to be able to read stdin until there are no more characters left. If I don't read all the characters they pop up on the command line when the program finishes. I currently read until I get what I know will be the last character but this seems rather hacked. Eric M. Boehm EMB978@ALBNY1VX.BITNET EMB978@LEAH.ALBANY.EDU