From owner-freebsd-java@FreeBSD.ORG Tue Mar 3 11:48:58 2015 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1492599 for ; Tue, 3 Mar 2015 11:48:58 +0000 (UTC) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88FA8D79 for ; Tue, 3 Mar 2015 11:48:58 +0000 (UTC) Received: from [89.204.138.8] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1YSlJl-0008JV-LL; Tue, 03 Mar 2015 12:48:54 +0100 Received: from localhost.my.domain (c720-r276659 [127.0.0.1]) by localhost.unixarea.de (8.14.9/8.14.9) with ESMTP id t23BmpPr001338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Mar 2015 12:48:51 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.14.9/8.14.9/Submit) id t23Bmo0o001337; Tue, 3 Mar 2015 12:48:50 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Tue, 3 Mar 2015 12:48:50 +0100 From: Matthias Apitz To: Ronald Klop Subject: Re: read unbuffered from STDIN Message-ID: <20150303114850.GA1322@c720-r276659> Reply-To: Matthias Apitz Mail-Followup-To: Matthias Apitz , Ronald Klop , freebsd-java@freebsd.org References: <20150227142014.GA4468@c720-r276659> <20150227150046.GA4811@c720-r276659> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT r269739 (i386) User-Agent: Mutt/1.5.23 (2014-03-12) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 89.204.138.8 Cc: freebsd-java@freebsd.org X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 11:48:58 -0000 El día Tuesday, March 03, 2015 a las 11:07:04AM +0100, Ronald Klop escribió: > On Fri, 27 Feb 2015 16:00:46 +0100, Matthias Apitz > wrote: > > > El día Friday, February 27, 2015 a las 03:20:14PM +0100, Matthias Apitz > > escribió: > > > >> This does not work in FreeBSD+eclipse and as well not when started as > >> > >> $ javac reader.java > >> $ java -cp . reader > > > > It does work when one does: > > > > $ stty raw ; java -cp . reader > > Enter characters, 'q' to quit. > > a > > a > > a > > > > Any ideas how to issue the 'stty raw' from within the java classes? > > > > matthias > > > > I have never used them, but java.io.Console and java.util.Scanner might > solve your issue. > http://docs.oracle.com/javase/7/docs/api/index.html?java/util/Scanner.html > http://docs.oracle.com/javase/7/docs/api/index.html?java/io/Console.html Thanks for the pointers; I have checked both and did some coding -- no luck; and there is no indication in both that one can switch the console into a RAW mode, as I showed with the above ioctl(2) call on cmd line. I'm a bit wondering, that this is so uncommon, due to the fact that device programmers (modems, all kind of serial line interfaces) for sure need the same thing. matthias -- Matthias Apitz, guru@unixarea.de, http://www.unixarea.de/ +49-170-4527211 La referencia de la Duma a la anexión de la RDA, en este caso al contrario con la Crimlía sin referéndum, no solamente tiene gracia sino da en el blanco.- Marinos Yannikos @MarinosYannikos en un blog de RTdeutsch.