called external program does not automatically write file
I have this program.exe which, after being called from a command line environment, e.g.:
C:\> program.exe input.inp
automatically writes a file (with a generic name), e.g. "output.out", in the directory I am working in.
However, when I try to call this program.exe from my java code, it does not write the output.out file as it does when using the command line.
my java code looks like:
try {
exe_path="C:/.../";
workDir_path="C:/.../";
Runtime rt = Runtime.getRuntime();
String [] command = {exe_path+"program.exe",workDir_path+"input.inp"};
Process p = rt.exec(command);
p.waitFor();
p.destroy();
} catch(Exception exc){ }
The path strings contain the absolute paths to both my program.exe and my working directory.
Any suggestion or idea why my program.exe called from inside my java code does not write the output.out file while this does happen in the command line mode? Maybe a suggestion on how to solve this?
thanks in advance,