H
Hal Vaughan
I'm using the snippet of code below to run a number of different programs to
check their output. I've had no trouble at all until, under Linux, as
root, it read through /etc/alternatives on a Debian system, where there are
many links to executables. The first time it runs one of these links, it
freezes. I've used debug statements and anything within the while loop is
never executed.
Is the problem with trying to run a link to an executable instead of the
executable itself? I am not getting any errors, just nothing happening.
The loop is entered, since any statements after it are never reached.
Why would Java lock up on trying to run a program and NOT throw an error?
The program runs fine from the command line.
Thanks!
Hal
----------Code Snippet-----------
Process p = Runtime.getRuntime().exec(sLine);
BufferedReader iStream = new BufferedReader (new
InputStreamReader(p.getInputStream()));
BufferedReader eStream = new BufferedReader (new
InputStreamReader(p.getErrorStream()));
while ((sReadIn = iStream.readLine()) != null || (sReadErr =
eStream.readLine()) != null) {
sOut = sOut + sReadIn; sErr = sErr + sReadErr;
}
check their output. I've had no trouble at all until, under Linux, as
root, it read through /etc/alternatives on a Debian system, where there are
many links to executables. The first time it runs one of these links, it
freezes. I've used debug statements and anything within the while loop is
never executed.
Is the problem with trying to run a link to an executable instead of the
executable itself? I am not getting any errors, just nothing happening.
The loop is entered, since any statements after it are never reached.
Why would Java lock up on trying to run a program and NOT throw an error?
The program runs fine from the command line.
Thanks!
Hal
----------Code Snippet-----------
Process p = Runtime.getRuntime().exec(sLine);
BufferedReader iStream = new BufferedReader (new
InputStreamReader(p.getInputStream()));
BufferedReader eStream = new BufferedReader (new
InputStreamReader(p.getErrorStream()));
while ((sReadIn = iStream.readLine()) != null || (sReadErr =
eStream.readLine()) != null) {
sOut = sOut + sReadIn; sErr = sErr + sReadErr;
}