Why can't I use log files in java runtime
I have (in java)
rt.exec("qq.exe -i ..(some other parameters) > qq.log");//*1
when I run qq.exe -i .. (some other parameters)> qq.log in the terminal. It works fine and saves the qq.log file correctly.
However, using rt.exec (* 1) does not work. "> qq.log" is causing the problem. When I delete this part, rt.exec (* 1) works, but this time I do not have the qq.log file.
What causes this problem and is there any soln ??
Java 7 ProcesBuilder.Redirect, // / . :
ProcessBuilder builder = new ProcessBuilder("cat", "/proc/meminfo");
// Append all errors from process to log file:
builder.redirectError(Redirect.appendTo(new File("/tmp/my.log")));
Process process = builder.start();
, . : Java 7.