Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Mar 2015 12:48:50 +0100
From:      Matthias Apitz <guru@unixarea.de>
To:        Ronald Klop <ronald-lists@klop.ws>
Cc:        freebsd-java@freebsd.org
Subject:   Re: read unbuffered from STDIN
Message-ID:  <20150303114850.GA1322@c720-r276659>
In-Reply-To: <op.xuw2d2jhkndu52@ronaldradial.radialsg.local>
References:  <20150227142014.GA4468@c720-r276659> <20150227150046.GA4811@c720-r276659> <op.xuw2d2jhkndu52@ronaldradial.radialsg.local>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <guru@unixarea.de>  
> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150303114850.GA1322>