displaying input/output of c programm on java gui

hi there...

i want to display the output of a c program that uses, printf's, puts on a

java gui. the c program has tones of these i dont want to edit them.

i am using JNI to run c from java.

does anybody know how i can capture the output of the c program and display it

on a java GUI..

cheers

[337 byte] By [generic-codera] at [2007-11-26 21:59:27]
# 1

Probably depends on where the C output is being written.

If it is going to sttdout, then you might be able to run the C program in a separate process, then capture the stdout and parse and display it (gag!)

Another idea - perhaps farfetched: write your own printf routine so that the data comes to a JNI shell instead of going where it is now? You'd have to do the smae for puts. Might not be too bad - you probably would only have to implement a small subset of the normal library capabilities.

bschauwejavaa at 2007-7-10 3:58:26 > top of Java-index,Java HotSpot Virtual Machine,Specifications...