Re: How to read from output streams

1999-07-04 Thread Mak

At 19:25 4/07/99 -0400, Michael Sinz wrote:

>Well, Win95 and Win98 have certain limits for console based programs.
>Many older (16-bit) programs don't actually use STDOUT/STDIN but rather
>write to the console directly (via "video memory")
>
>Also, under Win95/Win98 you have some problems with STDERR (as in there
>is no real OS definition and thus you can't redirect that)

May be this explains why I couldn't read or write to a C-program from Java

>
>You need to check what program you are trying to run and make sure it really
>is a 32-bit console app.  If it is not you will have far too many problems
>that you want to even think about :-(

I'll wait until i test it on Linux. I couldn't do this before as we haven't 
quite installed JDK on Linux machine at varsity yet.

Thanks a lot anyway for the help

-Mak






--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: How to read from output streams

1999-07-05 Thread Mak

Thanks a lot. It's really reassuring. I'll try this tomorrow on linux 
machine, hopefully.

THANKS A LOT AGAIN

-Mak

At 10:45 5/07/99 +0200, Cengiz Tuztas wrote:
>Yes, I use the following and it works under Linux Kernel 2.2.10 SuSE
>Dist 6.1.
>
> private int exec( String _command , String logname, boolean lock)
> {
> Runtime rt = Runtime.getRuntime();
> Process proc = null;
> int exitValue = 0;
>
> try {
> String line;
> proc = rt.exec( _command );
>
> BufferedReader brstdout = new
> BufferedReader( new InputStreamReader( 
> proc.getInputStream() ) );
> BufferedReader brstderr = new
> BufferedReader( new InputStreamReader( 
> proc.getErrorStream() ) );
>
> while ( ( line = brstderr.readLine() ) != null ) log( 
> logname, line
>);
> while ( ( line = brstdout.readLine() ) != null ) log( 
> logname, line
>);
>
> if ( lock )
> exitValue = proc.waitFor();
> }
> catch ( IOException ioe )
> {
> log( logname, ioe.getMessage() );
> }
> catch ( InterruptedException ie )
> {
> log( logname, ie.getMessage() );
> }
> return exitValue;
>
>
>--
>---
>Cengiz Tuztas
>Dipl. - Wirt. Inform.
>
>ADA - Das SystemHaus GmbH
>Berliner Platz 12 - 41061 Mönchengladbach
>Tel.: 0 21 61 / 655 - 7247, Fax: -7216
>---


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]