(runProcessEx wait cmd args env workdir in out err) runs a command cmd.
It searches the application along the
current directory, the windows system directories and finally the current PATH.
The command is run with the arguments args. If wait is True, the current
process is suspended until the child terminates, otherwise they are run concurrently. If the environment env is (Just pairs),
the command is executed with the environment specified by pairs of variables and values; otherwise,
the command is executed with the current environment. If workdir is (Just dir), the command is executed
with working directory dir and otherwise, the command is executed in the current working directory. If {in,out,err} is (Just handle), the command is executed with
std{in,out,err} attached to the specified handle;
otherwise, std{in,out,err} is left unchanged. If wait is True, the call to runProcessEx returns after the child process
has terminated with the exit code of the process. If wait is false, the
call to runProcessEx returns immediately with an exit code of 0. Here is a short example of running a command cmd that gets its input
from a file foo. The process is run synchronously. do{ input <- openFile "foo" ReadMode
; exitcode <- runProcessEx True "cmd" [] Nothing Nothing (Just input) Nothing Nothing
; hClose input
; ...
|