A
Andrew Regan
I'm using Process runner = Runtime.getRuntime().exec( cmdArgs );
where cmdArgs {"/bin/sh", "-c", <perl program>}.
If <perl program> is "/opt/vr/bin/show_active_servers" I can get the input
stream and read what the perl program outputs as follows. In fact it works
for any of the 4 programs in /opt/vr/bin directory.
BufferedReader is = new BufferedReader(new
InputStreamReader(runner.getInputStream()));
while((line = is.readLine()) != null){
System.out.println(line);
}
However if I change the program to "/opt/vr/etc/vr_report" I can't read any
of the programs output. No exceptions are thrown. The exit level of the
process is 0. I have tried inserting waitFors(). The perl programs are all
chmoded the same and are owned by the same user. I have also tried reading
from stderror and can't get any of the programs output. I have timed the
programs and the times seem to indicate that the java program is executing
the perl program, but I can't read any of its output?
Any ideas?
Thanks for your help,
Andrew Regan
where cmdArgs {"/bin/sh", "-c", <perl program>}.
If <perl program> is "/opt/vr/bin/show_active_servers" I can get the input
stream and read what the perl program outputs as follows. In fact it works
for any of the 4 programs in /opt/vr/bin directory.
BufferedReader is = new BufferedReader(new
InputStreamReader(runner.getInputStream()));
while((line = is.readLine()) != null){
System.out.println(line);
}
However if I change the program to "/opt/vr/etc/vr_report" I can't read any
of the programs output. No exceptions are thrown. The exit level of the
process is 0. I have tried inserting waitFors(). The perl programs are all
chmoded the same and are owned by the same user. I have also tried reading
from stderror and can't get any of the programs output. I have timed the
programs and the times seem to indicate that the java program is executing
the perl program, but I can't read any of its output?
Any ideas?
Thanks for your help,
Andrew Regan