úÎŹťŚZL      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK Safe-Inferred      Safe-Inferred246"Create a new pipe. The returned HandleI will use the default encoding and newline translation mode (just like Handle s created by openFile).Use the supplied HandleInherit Handle from parent L MNOPQRST    L  MNOPQRST Safe-Inferred246 2The name of an executable with a list of argumentsThe U argument names the executable, and is interpreted according to the platform's standard policy for searching for executables. Specifically:on Unix systems the  Ehttp://pubs.opengroup.org/onlinepubs/9699919799/functions/execvp.html execvp(3)U semantics is used, where if the executable filename does not contain a slash (/ ) then the PATH8 environment variable is searched for the executable.on Windows systems the Win32  CreateProcessě semantics is used. Briefly: if the filename does not contain a path, then the directory containing the parent executable is searched, followed by the current directory, then some standard locations, and finally the current PATH. An .exek extension is added if the filename does not already have an extension. For full details see the  Rhttp://msdn.microsoft.com/en-us/library/windows/desktop/aa365527%28v=vs.85%29.aspx documentation for the Windows  SearchPath API.!)A command line to execute using the shell !VWXYZ[\]^_`  ! ! ! VWXYZ[\]^_` Safe-Inferred246 "'Types that relate to delegating CTRL-C.$%Types that relate to creating groups.&)Types that relate to closing descriptors.(-Types that relate to a standard error stream.*.Types that relate to a standard output stream.,-Types that relate to a standard input stream..$Types that relate to an environment.01Types that relate to a (maybe) working directory.2Types that related to  CreateProcess.+"#$%&'()*+,-./012345abcdefghijklmnopqrstuvw"#$%&'()*+,-./012345452301./,-*+()&'$%"#!"#$%&'()*+,-./012345abcdefghijklmnopqrstuvw Safe-Inferred6˙This is the most general way to spawn an external process. The process can be a command line to be executed by a shell or a raw command with a list of arguments. The stdin, stdout, and stderr streams of the new process may individually be attached to new pipes, to existing x3s, or just inherited from the parent (the default.);The details of how to create the process are passed in the 4+ record. To make it easier to construct a 4, the functions 9 and 8[ are supplied that fill in the fields with default values which can be overriden as needed.6 returns ( mb_stdin_hdl,  mb_stdout_hdl,  mb_stderr_hdl, ph), whereif std_in == , then  mb_stdin_hdl will be Just h , where hB is the write end of the pipe connected to the child process's stdin. otherwise,  mb_stdin_hdl == NothingSimilarly for  mb_stdout_hdl and  mb_stderr_hdl.!For example, to execute a simple ls command: # r <- createProcess (proc "ls" [])2To create a pipe from which to read the output of ls: T (_, Just hout, _, _) <- createProcess (proc "ls" []){ std_out = CreatePipe }*To also set the directory in which to run ls:  (_, Just hout, _, _) <- createProcess (proc "ls" []){ cwd = Just "\home\bob", std_out = CreatePipe } Note that Handles provided for std_in, std_out, or std_err via the  UseHandleŠ constructor will be closed by calling this function. This is not always the desired behavior. In cases where you would like to leave the Handle3 open after spawning the child process, please use 7 instead.see .7&This function is almost identical to . The only differences are:xs provided via  are not closed automatically.This function takes an extra String3 argument to be used in creating error messages.see  .8 Construct a 4 record for passing to 64, representing a command to be passed to the shell.see  .9 Construct a 4 record for passing to 6-, representing a raw command with arguments.See  ( for precise semantics of the specified FilePath.see  .:ŻCreates a new process to run the specified command with the given arguments, and wait for it to finish. If the command returns a non-zero exit code, an exception is raised.@If an asynchronous exception is thrown to the thread executing  callProcess-. The forked process will be terminated and  callProcess: will wait (block) until the process has been terminated.see 'System.Process.callProcess.;€Creates a new process to run the specified shell command. If the command returns a non-zero exit code, an exception is raised.@If an asynchronous exception is thrown to the thread executing  callCommand-. The forked process will be terminated and  callCommand: will wait (block) until the process has been terminated.see 'System.Process.callCommand.<Creates a new process to run the specified raw command with the given arguments. It does not wait for the program to finish, but returns the  ProcessHandle. see 'System.Process.spawnProcess.=wCreates a new process to run the specified shell command. It does not wait for the program to finish, but returns the  ProcessHandle. see 'System.Process.spawnCommand.>readCreateProcess works exactly like ? except that it lets you pass 4 giving better flexibility. A > readCreateProcess (shell "pwd" { cwd = "/etc/" }) "" "/etc\n" Note that Handles provided for std_in or std_out/ via the CreateProcess record will be ignored.see  .@readCreateProcessWithExitCode works exactly like A except that it lets you pass 4 giving better flexibility. Note that Handles provided for std_in, std_out, or std_err/ via the CreateProcess record will be ignored.see  .AreadProcessWithExitCode is like  readProcess but with two differences:it returns the I of the process, and does not throw any exception if the code is not  ExitSuccess.†it reads and returns the output from process' standard error handle, rather than the process inheriting the standard error handle.On Unix systems, see CP for the meaning of exit codes when the process died as the result of a signal.see .BGiven a program p and arguments args, showCommandForUser p args/ returns a string suitable for pasting into /bin/sh (on Unix systems) or CMD.EXE (on Windows).see .CHWaits for the specified process to terminate, and returns its exit code.GHC Note: in order to call waitForProcessY without blocking all the other threads in the system, you must compile the program with  -threaded."On Unix systems, a negative value  ExitFailure -signum3 indicates that the child was terminated by signal signumk. The signal numbers are platform-specific, so to test for a specific signal use the constants provided by System.Posix.Signals in the unix1 package. Note: core dumps are not reported, use System.Posix.Process if you need this detail.see .D"This is a non-blocking version of C$. If the process is still running, Nothing/ is returned. If the process has exited, then Just e is returned where e! is the exit code of the process.On Unix systems, see CO for the meaning of exit codes when the process died as the result of a signal.see .EńAttempts to terminate the specified process. This function should not be used under normal circumstances - no guarantees are given regarding how cleanly the process is terminated. To check whether the process has indeed terminated, use D.On Unix systems, EF sends the process the SIGTERM signal. On Windows systems, the Win32 TerminateProcess0 function is called, passing an exit code of 1.ANote: on Windows, if the process was a shell command created by 6 with 8, or created by  runCommand or runInteractiveCommand, then E’ will only terminate the shell, not the command itself. On Unix systems, both processes are in a process group and will be terminated together.$see 'System.Process.terminateProcess.FDSends an interrupt signal to the process group of the given process.6On Unix systems, it sends the group the SIGINT signal.dOn Windows systems, it generates a CTRL_BREAK_EVENT and will only work for processes created using 6 and setting the  create_group flag+see 'System.Process.interruptProcessGroupOf.G;Create a pipe for interprocess communication and return a (readEnd, writeEnd) x pair.see .67"function name (for error messages)89:;<=>standard inputstdout? Filename of the executable (see   for details) any argumentsstandard inputstdout@standard inputexitcode, stdout, stderrA Filename of the executable (see   for details) any argumentsstandard inputexitcode, stdout, stderrBCDEFA process in the process groupG?  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG6789:;<=>?@ABCDEFG6789:;<=>?@ABCDEFG Safe-InferredH Computation H code throws  code3. Normally this terminates the program, returning code to the program's caller.%On program termination, the standard xs y and z/ are flushed automatically; any other buffered xOs need to be flushed manually, otherwise the buffered data will be discarded.FA program that fails in any other way is treated as if it had called :. A program that terminates successfully without calling H, explicitly is treated as it it had called H  ExitSuccess.As an  is not an {, H% bypasses the error handling in the |% monad and cannot be intercepted by catch from the Prelude. However it is a  SomeException,, and can be caught using the functions of Control.Exception4. This means that cleanup computations added with  (from Control.Exception ) are also executed properly on H.Note: in GHC, Hq should be called from the main program thread in order to exit the process. When called from another thread, H will throw an  ExitExceptionI as normal, but the exception will not cause the process itself to exit.see 'System.Exit.exitWith.JThe computation J is equivalent to H ( ExitFailure exitfail) , where exitfail is implementation-dependent. see 'System.Exit.exitWithFailure.KThe computation K is equivalent to H  ExitSuccess*, It terminates the program successfully. see 'System.Exit.exitWithSuccess.HIJKL  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKHIJKHIJK} !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKK   LMNO P QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„`…†`‡ˆ`‡‰`Š‹ŒŽsys-process-0.1.3 Sys.Process Sys.ExitCode Sys.StdStream Sys.CmdSpecSys.CreateProcessSys.ExitSystem.Process createProcesscreateProcess_shellprocreadCreateProcessreadCreateProcessWithExitCodereadProcessWithExitCodeshowCommandForUserwaitForProcessgetProcessExitCode createPipeControl.Exceptionbracketprocess-1.2.3.0System.Process.Internals ProcessHandleExitCode _ExitFailure _ExitSuccess exitFailure exitSuccess exitFailureP exitSuccessPexitCode unExitCode AsCreatePipe AsUseHandle _UseHandle AsInherit_Inherit AsStdStream _StdStream StdStream CreatePipe UseHandleInherit AsRawCommand _RawCommandAsShellCommand _ShellCommandAsExecutableArguments_ExecutableArgumentsAsExecutableName_ExecutableName AsCmdSpec_CmdSpecCmdSpec RawCommand ShellCommandAsDelegateCtrlC_DelegateCtrlC AsCreateGroup _CreateGroupAsCloseDescriptors_CloseDescriptorsAsStderr_StderrAsStdout_StdoutAsStdin_Stdin AsEnvironment _EnvironmentAsWorkingDirectory_WorkingDirectoryAsCreateProcess_CreateProcess CreateProcess callProcess callCommand spawnProcess spawnCommand readProcessterminateProcessinterruptProcessGroupOfexitWithexitWithFailureexitWithFailure1exitWithSuccess _CreatePipe$fAsCreatePipepfStdStream$fAsCreatePipepf()$fAsUseHandlepfStdStream$fAsUseHandlepfHandle$fAsInheritpfStdStream$fAsInheritpf()$fAsStdStreampfStdStream$fAsStdStreampfStdStream0baseGHC.IOFilePath$fAsRawCommandpfCmdSpec$fAsRawCommandpf(,)$fAsShellCommandpfCmdSpec$fAsShellCommandpf[]#$fAsExecutableArguments(->)fCmdSpec$fAsExecutableArgumentspf[]$fAsExecutableName(->)fCmdSpec$fAsExecutableNamepf[]$fAsCmdSpecpfCmdSpec$fAsCmdSpecpfCmdSpec0$fIsStringCmdSpec#$fAsDelegateCtrlC(->)fCreateProcess$fAsDelegateCtrlCpfBool!$fAsCreateGroup(->)fCreateProcess$fAsCreateGrouppfBool&$fAsCloseDescriptors(->)fCreateProcess$fAsCloseDescriptorspfBool$fAsStderr(->)fCreateProcess$fAsStderrpfStdStream$fAsStdout(->)fCreateProcess$fAsStdoutpfStdStream$fAsStdin(->)fCreateProcess$fAsStdinpfStdStream!$fAsEnvironment(->)fCreateProcess$fAsEnvironmentpfMaybe&$fAsWorkingDirectory(->)fCreateProcess$fAsWorkingDirectorypfMaybe $fAsRawCommand(->)fCreateProcess"$fAsShellCommand(->)fCreateProcess)$fAsExecutableArguments(->)fCreateProcess$$fAsExecutableName(->)fCreateProcess$fAsCmdSpec(->)fCreateProcess $fAsCreateProcesspfCreateProcess!$fAsCreateProcesspfCreateProcess0GHC.IO.Handle.TypesHandleGHC.IO.Handle.FDstdoutstderrGHC.IO.ExceptionIOErrorghc-prim GHC.TypesIO