J
John Leslie
I am using the following borrowed code to run unix commands.
Occasionally it returns 3, apparently without actually running the
command and I do not know why.
I would like to get more info on the error and write it to a file.
As I am not a java programmer can someone help me amend the code to
write the error details of the t object to a file?
Thanks in advance.
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(Command);
try {
rc = p.waitFor();
} catch (InterruptedException intexc) { rc = 2; }
rt.gc();
} catch (Throwable t) { rc = 3; }
Occasionally it returns 3, apparently without actually running the
command and I do not know why.
I would like to get more info on the error and write it to a file.
As I am not a java programmer can someone help me amend the code to
write the error details of the t object to a file?
Thanks in advance.
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(Command);
try {
rc = p.waitFor();
} catch (InterruptedException intexc) { rc = 2; }
rt.gc();
} catch (Throwable t) { rc = 3; }