AFAIK if you use jni it doesn't create separate process. The problem is to 
capture output of the same process.
For Unix-only solution I would try to create named pipe, redirect java
process's output to that pipe and see if I can read it from inside the program.
It's just an idea. I haven't tried it.


On 24-Aug-99 [EMAIL PROTECTED] wrote:
> Here's one way of trapping stdout from an unrelated program.  I'm pretty
> sure there's better way, but this works in Blackdown 1.2v1.
> 
>       Process process = Runtime.getRuntime().exec("yourprogram");
>       process.waitFor();
> 
>       // getInputStream() returns the input stream connected to the normal
>       // output of the subprocess.
> 
>       BufferedReader in =
>            new BufferedReader(new
> InputStreamReader(process.getInputStream()));
> 
>       while((line = in.readLine()) != null){
>         System.out.println(line);
>         // Or whatever....
>       }
> 
> -Jerry
> 
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

----------------------------------
E-Mail: [EMAIL PROTECTED]
Date: 24-Aug-99
Time: 10:31:45


Andrey.
----------------------------------


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

Reply via email to