Re: [JAVA] Unbuffered access to stdin
From: Gordon Beaton (not_at_for.email)
Date: 03/05/05
- Next message: jesper: "Re: tomcat 5.5.7 autoDeploy/reload trouble"
- Previous message: Max: "Re: [JAVA] Unbuffered access to stdin"
- In reply to: Max: "Re: [JAVA] Unbuffered access to stdin"
- Next in thread: Max: "Re: [JAVA] Unbuffered access to stdin"
- Reply: Max: "Re: [JAVA] Unbuffered access to stdin"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 5 Mar 2005 20:38:01 +0100
On Sat, 05 Mar 2005 21:05:44 +0200, Max wrote:
> I am writing an interpreter for an esoteric language (in the vein of
> BrainF***). The only input instruction is read-byte-to-stack.
I'll interpret that to mean that you want to be able to read from
System.in without waiting for the user to press enter - is that right?
If so, it's your OS console, not Java's buffering of System.in that
prevents it, and consequently unbuffering System.in (alone) won't let
you do it.
You *can* read individual bytes from System.in without waiting for
enter. Try piping input from a file or other source to see that it's
possible.
On unix-like platforms, you can use "stty -icanon min 1" to change
console mode so you can do character-at-a-time input. On other
operating systems, I have no idea.
/gordon
-- [ do not email me copies of your followups ] g o r d o n + n e w s @ b a l d e r 1 3 . s e
- Next message: jesper: "Re: tomcat 5.5.7 autoDeploy/reload trouble"
- Previous message: Max: "Re: [JAVA] Unbuffered access to stdin"
- In reply to: Max: "Re: [JAVA] Unbuffered access to stdin"
- Next in thread: Max: "Re: [JAVA] Unbuffered access to stdin"
- Reply: Max: "Re: [JAVA] Unbuffered access to stdin"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|