I am using Windows!
I want to call a small .exe application from my java command line which is called "saucy.exe". It needs an input file "input.saucy". Both are stored in the correct directory.
When I use the command
Process p = Runtime.getRuntime().exec("saucy input.saucy");
everything works fine and I get an output on the console.
However, when I try to write the output in a file
Process p = Runtime.getRuntime().exec("saucy input.saucy > output.saucy");
nothing happens.
I already found the advice in http://www.ensta-paristech.fr/~diam/java/online/io/javazine.html and tried to tokenize the command manually:
String[] cmd = {"saucy", "input.saucy > output.saucy"};
Process p = Runtime.getRuntime().exec(cmd);
It is still not working. Any advice? It is no option for me to write the output to a file with java code, because its too slow.
Again: I am using Windows (I stress that because I read several hints for Linux systems).
>is a shell command, but you are not using one. tryString[] cmd = { "cmd", "/C", "saucy input.saucy > output.saucy" };String[] cmd = { "cmd", "/C", "folder/saucy input.saucy > output.saucy" };andString[] cmd = { "cmd", "/C", "folder\\saucy input.saucy > output.saucy" };which gave me the error that: application 'folder' could not been found.C:\\basedirectory\\folder\\saucy