Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Console-Program and Pipes

Author: Thomas Mayer

Date: 14:00:14 02/20/06

Go up one level in this thread


Hi Peter,

On February 20, 2006 at 15:50:50, Peter Schäfer wrote:

>On February 20, 2006 at 14:59:34, Thomas Mayer wrote:
>
>>
>>P.S.: I search for the same in Java... :) There is code in José for that, but
>>like you I would like to have something a BIT shorter... :)
>
>
>Basically, it's quite simple:
>
> Process process = Runtime.exec("myprogram ...");
> BufferedReader input = new BufferedReader(new
>InputStreamReader(process.getInputStream()));
> PrintWriter output = new PrintWriter(process.getOutputStream());
>
> output.println("Hello");
> String response = input.readLine();
>
>It get's a bit more complicated if you want to have non-blocking IO in a Swing
>application.
>Here's a pretty good article:
>http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html

thanks for the link and the basics... In fact I plan to program a little GUI for
Quark in the future and since Java does become more important in my business
life I thought it might be a good idea to write that in Java... And of course my
first look was in the José Source to see how things could be done... ;)

Greets, Thomas



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.