From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA13249; Thu, 21 Aug 2003 18:40:19 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA17579 for ; Thu, 21 Aug 2003 18:40:18 +0200 (MET DST) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h7LGeGT17766 for ; Thu, 21 Aug 2003 18:40:17 +0200 (MET DST) Received: (qmail 11756 invoked from network); 21 Aug 2003 16:40:12 -0000 Received: from unknown (HELO apprentice.genxnet.com) ([64.81.145.152]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 21 Aug 2003 16:40:12 -0000 Date: Thu, 21 Aug 2003 11:47:36 -0500 From: art yerkes To: caml-list@inria.fr Subject: Re: [Caml-list] unbuffered input Message-Id: <20030821114736.046dbbca.ayerkes@speakeasy.net> In-Reply-To: <20030821161157.GH18587@alan-schm1p> References: <20030821161157.GH18587@alan-schm1p> X-Mailer: Sylpheed version 0.8.11 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; yerkes:01 ayerkes:01 caml-list:01 char:01 char:01 buffering:01 icanon:01 tcsetattr:01 buffering:01 libc:01 caml:01 caml:01 speakeasy:01 unix:02 unix:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 21 Aug 2003 12:11:57 -0400 Alan Schmitt wrote: > Hi, > > I've been looking at this for about one hour, and I seem to get stuck: > how can I do unbuffered input in caml ? I want a program to block until > a char is entered. I tried input_char and Unix.read (without > and with Unix.select), to no avail. I do not know if it is caml, the > libc, or the terminal that is buffering. > > Any hint on how to do this ? > > Thanks a lot, > > Alan Schmitt > You need to turn off c_icanon using Unix.tcsetattr. It's the terminal driver that does the buffering. -- "Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration." - S. Kelly-Bootle ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners