Process Spawning and I/O redirection
Posted on 1997-05-06
I am trying to do the following but can't seem to find a way to
do it in java. I am looking for suggestions ...
I am looking for a way to spawn a process and redirect the stdout
and stderr to a file. What I did in C/C++ was to create a file
in the parent process and manipulate the stdout and stderr (using
dup on unix and the win32 CreateProcess API on NT) and then spawn
the child. Is there a way to achieve this ?
The child process is a legacy app (I don't have the source code).
I just want to launch it and make its stdout and stderr go to a
Also, after spawning the process, I am looking for a way to verify
if the process is running or terminated. Is there anyway to do this ?
I have the process handle/class that was returned when the process
was spawned. I couldn't find an API call for that either.
I guess if I can do the above, I will look for more :-) facilities
like retrieving environment variables and setting uid's etc. For
now, I'd like to start with these.
Any help appreciated.