Hello friends,
I am trying to write a process's prints into a log.
Using the Process API I can do this:
m_compileProcess = Runtime.getRuntime().exec(commandline);
BufferedReader err = new BufferedReader(
new
InputStreamReader(m_compileProcess.getErrorStream()));
BufferedReader out = new BufferedReader(
new
InputStreamReader(m_compileProcess.getInputStream()));
But what I really need is to get the error stream and the output
stream to go into the same place.
How do I go about that??
thanks,
ruthie
Gordon Beaton - 16 Apr 2007 12:09 GMT
> But what I really need is to get the error stream and the output
> stream to go into the same place. How do I go about that??
There are two alternatives:
- use ProcessBuilder instead of Runtime.exec
- use shell redirection in the command itself
/gordon
--
ruthie - 16 Apr 2007 12:40 GMT
> - use ProcessBuilder instead of Runtime.exec
It works, thanks!
This is exactly what I needed.
ruthie