h*kh      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm1.6.20.0 Safe-Inferred%&processA handle to a process, which can be used to wait for termination of the process using .None of the process-creation functions in this library wait for termination: they all return a 6 which may be used to wait for the process later.On Windows a second wait method can be used to block for event completion. This requires two handles. A process job handle and a events handle to monitor. process 9 is only applicable for Windows platform. It represents  https://learn.microsoft.com/en-us/windows/win32/procthread/job-objects Job Objects.process the processprocess4the job containing the process and its subprocessesprocessInherit Handle from parentprocessUse the supplied Handleprocess"Create a new pipe. The returned Handle will use the default encoding and newline translation mode (just like Handle s created by openFile).processClose the stream's file descriptor without passing a Handle. On POSIX systems this may lead to strange behavior in the child process because attempting to read or write after the file has been closed throws an error. This should only be used with child processes that don't use the file descriptor at all. If you wish to ignore the child process's output you should either create a pipe and drain it manually or pass a Handle that writes to  /dev/null.process)A command line to execute using the shellprocess2The name of an executable with a list of argumentsThe n argument names the executable, and is interpreted according to the platform's standard policy for searching for executables. Specifically:on Unix systems the  http://pubs.opengroup.org/onlinepubs/9699919799/functions/execvp.html execvp(3) 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 .exe extension is added if the filename does not already have an extension. For full details see the  http://msdn.microsoft.com/en-us/library/windows/desktop/aa365527%28v=vs.85%29.aspx documentation for the Windows  SearchPath API.Windows does not have a mechanism for passing multiple arguments. When using  RawCommand on Windows, the command line is serialised into a string, with arguments quoted separately. Command line parsing is up individual programs, so the default behaviour may not work for some programs. If you are not getting the desired results, construct the command line yourself and use .processcontains the handles returned by a call to createProcess_Internal!process.Executable & arguments, or shell command. If " is o, relative paths are resolved with respect to the current working directory. If " is provided, it is implementation-dependent whether relative paths are resolved with respect to " or the current working directory, so absolute paths should be used to ensure portability."process:Optional path to the working directory for the new process#processOptional environment (otherwise inherit from the current process)$processHow to determine stdin%processHow to determine stdout&processHow to determine stderr'processClose all file descriptors except stdin, stdout and stderr in the new process (on Windows, only works if std_in, std_out, and std_err are all Inherit). This implementation will call close on every fd from 3 to the maximum of open files, which can be slow for high maximum of open files. XXX verify what happens with fds in nodejs child processes(processCreate a new process group. On JavaScript this also creates a new session.)processDelegate control-C handling. Use this for interactive console processes to let them handle control-C themselves (see below for details).*processUse the windows DETACHED_PROCESS flag when creating the process; does nothing on other platforms.+processUse the windows CREATE_NEW_CONSOLE flag when creating the process; does nothing on other platforms. Default: False,processUse posix setsid to start the new process in a new session; starts process in a new session on JavaScript; does nothing on other platforms.-processUse posix setgid to set child process's group id; works for JavaScript when system running nodejs is posix. does nothing on other platforms. Default: Nothing.processUse posix setuid to set child process's user id; works for JavaScript when system running nodejs is posix. does nothing on other platforms. Default: Nothing/processOn Windows systems this flag indicates that we should wait for the entire process tree to finish before unblocking. On POSIX systems this flag is ignored. See $exec-on-windows for details. Default: Falsepprocess construct a  from a string literal8 !"#$%&'()*+,-./   1023qrstuvw Safe-InferredxprocessTurns a shell command into a raw command. Usually this involves wrapping it in an invocation of the shell.There's a difference in the signature of commandToProcess between the Windows and Unix versions. On Unix, exec takes a list of strings, and we want to pass our command to binsh as a single argument.On Windows, CreateProcess takes a single string for the command, which is later decomposed by cmd.exe. In this case, we just want to prepend "c:WINDOWSCMD.EXE /c" to our command line. The command-line translation that we normally do for arguments on Windows isn't required (or desirable) here.7processrunInteractiveProcess blocks signals around the fork(). Since blocking/unblocking of signals is a global state operation, we need to ensure mutual exclusion of calls to runInteractiveProcess. This lock is exported so that other libraries which also need to fork() (and also need to make the same global state changes) can protect their changes with the same lock. See  +https://github.com/haskell/process/pull/154.yprocessA process in the process group4z{658:9|;<}~y7"(c) The University of Glasgow 2004/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimentalportable Trustworthy &p=process&This function is almost identical to  . The only differences are:s provided via  are not closed automatically.This function takes an extra String3 argument to be used in creating error messages.*This function has been available from the System.Process.Internals+ module for some time, and is part of the System.Process module since version 1.2.1.0.Aprocess;Create a pipe for interprocess communication and return a (readEnd, writeEnd)  pair. WinIO SupportWhen this function is used with WinIO enabled it's the caller's responsibility to register the handles with the I/O manager. If this is not done the operation will deadlock. Association can be done as follows:  #if defined(IO_MANAGER_WINIO ) import GHC.IO.SubSystem (( !)) import GHC.IO.Handle.Windows (handleToHANDLE) import GHC.Event.Windows (associateHandle') #endif ... #if defined (IO_MANAGER_WINIO) return ()  ! (do associateHandle' = <handleToHANDLE ABCDE   05423 !"#$%&'()*+,-./=@8:9?7;<16>ABCDE Safe-Inferred.FprocessA F6 is an operating-system specific representation of a ; that can be communicated through a command-line interface.In a typical use case, the parent process creates a pipe, using e.g. createWeReadTheyWritePipe or createTheyReadWeWritePipe.One end of the pipe is a >, which can be read from/written to by the parent process.The other end is a F, which can be inherited by a child process. A reference to the handle can be serialised (using the  instance), and passed to the child process. It is recommended to close the parent's reference to the F using I6 after it has been inherited by the child process.&The child process can deserialise the F (using the  instance), and then use openCommunicationHandleWrite or openCommunicationHandleRead in order to retrieve a % which it can write to/read from.0readCreateProcessWithExitCodeCommunicationHandle provides a high-level API to this functionality. See there for example code.Hprocess!Internal function used to define openCommunicationHandleRead# and openCommunicationHandleWrite.IprocessClose a F.Use this to close the F" in the parent process after the F) has been inherited by the child process.Jprocess(Internal helper function used to define createWeReadTheyWritePipe and createTheyReadWeWritePipe! while reducing code duplication.Jprocess (we read, they write) or swap (they read, we write)processwhether to pass a handle supporting asynchronous I/O to the child process (this flag only has an effect on Windows and when using WinIO)FGIHJFGIHJ'(c) The University of Glasgow 2004-2008/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental#non-portable (requires concurrency)Safe aOprocess4The platform specific type for a process identifier.This is always an integral type. Width and signedness are platform specific.Pprocess Construct a  record for passing to R-, representing a raw command with arguments.See ( for precise semantics of the specified FilePath.Qprocess Construct a  record for passing to R4, representing a command to be passed to the shell.RprocessThis 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 3s, or just inherited from the parent (the default.);The details of how to create the process are passed in the + record. To make it easier to construct a , the functions P and Q are supplied that fill in the fields with default values which can be overriden as needed.R returns ( mb_stdin_hdl,  mb_stdout_hdl,  mb_stderr_hdl, ph), whereif $ == , then  mb_stdin_hdl will be Just h , where h 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:  (_, 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 = instead. All created Handles are initially in text mode; if you need them to be in binary mode then use .ph7 contains a handle to the running process. On Windows / can be set in CreateProcess in order to create a Win32 Job object to monitor a process tree's progress. If it is set then that job is also returned inside ph. ph can be used to kill all running sub-processes. This feature has been available since 1.5.0.0.SprocessA -style resource handler for R.Does automatic cleanup when the action finishes. If there is an exception in the body then it ensures that the process gets terminated and any  s are closed. In particular this means that if the Haskell thread is killed (e.g. 1), that the external process is also terminated.e.g. withCreateProcess (proc cmd args) { ... } $ \stdin stdout stderr ph -> do ...TprocessCleans up the process.This function is meant to be invoked from any application level cleanup handler. It terminates the process, and closes any  handles.UprocessCreates 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 .VprocessCreates a new process to run the specified shell command. It does not wait for the program to finish, but returns the .WprocessCreates 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.XprocessCreates 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.Yprocess readProcess forks an external process, reads its standard output strictly, blocking until the process terminates, and returns the output string. The external process inherits the standard error.If an asynchronous exception is thrown to the thread executing  readProcess,, the forked process will be terminated and  readProcess: will wait (block) until the process has been terminated.Output is returned strictly, so this is not suitable for launching processes that require interaction over the standard file streams.This function throws an  if the process  is anything other than ". If instead you want to get the  then use [.+Users of this function should compile with  -threaded if they want other Haskell threads to keep running while waiting on the result of readProcess. = > readProcess "date" [] [] "Thu Feb 7 10:03:39 PST 2008\n"The arguments are:The command to run, which must be in the $PATH, or an absolute or relative path?A list of separate command line arguments to the program. See 0 for further discussion of Windows semantics.9A string to pass on standard input to the forked process.ZprocessreadCreateProcess works exactly like Y except that it lets you pass  giving better flexibility.  > readCreateProcess ((shell "pwd") { cwd = Just "/etc/" }) "" "/etc\n" Note that Handles provided for std_in or std_out/ via the CreateProcess record will be ignored.[processreadProcessWithExitCode is like Y but with two differences:it returns the  of the process, and does not throw any exception if the code is not .it reads and returns the output from process' standard error handle, rather than the process inheriting the standard error handle.On Unix systems, see ` for the meaning of exit codes when the process died as the result of a signal.\processreadCreateProcessWithExitCode works exactly like [ except that it lets you pass  giving better flexibility. Note that Handles provided for std_in, std_out, or std_err/ via the CreateProcess record will be ignored.]processGiven 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).^process-Returns the PID (process ID) of a subprocess.o is returned if the handle was already closed. Otherwise a PID is returned that remains valid as long as the handle is open. The operating system may reuse the PID as soon as the last handle to the process is closed._ processReturns the PID (process ID) of the current process. On POSIX systems, this calls  from System.Posix.Process in the unix" package. On Windows, this calls getCurrentProcessId from System.Win32.Process in the Win32 package.`processWaits for the specified process to terminate, and returns its exit code. On Unix systems, may throw  UserInterrupt when using ).GHC Note: in order to call waitForProcess without blocking all the other threads in the system, you must compile the program with  -threaded.Note that it is safe to call waitForProcess for the same process in multiple threads. When the process ends, threads blocking on this call will wake in FIFO order. When using ) and the process is interrupted, only the first waiting thread will throw  UserInterrupt.(Since: 1.2.0.0$) On Unix systems, a negative value  -signum3 indicates that the child was terminated by signal signum. 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.aprocess"This is a non-blocking version of `$. If the process is still running, o/ is returned. If the process has exited, then  e is returned where e! is the exit code of the process.On Unix systems, see ` for the meaning of exit codes when the process died as the result of a signal. May throw  UserInterrupt when using ).bprocessAttempts 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 a.On Unix systems, b? sends the process the SIGTERM signal. On Windows systems, if / is  then the Win32 TerminateJobObject function is called to kill all processes associated with the job and passing the exit code of 1 to each of them. Otherwise if / is  then the Win32 TerminateProcess/ function is called, passing an exit code of 1.Note: on Windows, if the process was a shell command created by R with Q, or created by c or e, then b will only terminate the shell, not the command itself. On Unix systems, both processes are in a process group and will be terminated together.cprocessRuns a command using the shell.dprocess*Runs a raw command, optionally specifying s from which to take the stdin, stdout and stderr channels for the new process (otherwise these handles are inherited from the current process).Any  s passed to d1 are placed immediately in the closed state.&Note: consider using the more general R instead of d.eprocess,Runs a command using the shell, and returns s that may be used to communicate with the process via its stdin, stdout , and stderr respectively.fprocess Runs a raw command, and returns s that may be used to communicate with the process via its stdin, stdout and stderr respectively.?For example, to start a process and feed a string to its stdin:  (inp,out,err,pid) <- runInteractiveProcess "..." forkIO (hPutStr inp str)gprocess Computation  system cmd returns the exit code produced when the operating system runs the shell command cmd.4This computation may fail with one of the following    exceptions: PermissionDeniedThe process has insufficient privileges to perform the operation.ResourceExhausted>Insufficient resources are available to perform the operation.UnsupportedOperation1The implementation does not support system calls. On Windows, g8 passes the command to the Windows command interpreter (CMD.EXE or  COMMAND.COM*), hence Unixy shell tricks will not work.On Unix systems, see ` for the meaning of exit codes when the process died as the result of a signal.hprocessThe computation h cmd args# runs the operating system command cmd1 in such a way that it receives as arguments the args strings exactly as given, with no funny escaping or shell meta-syntax expansion. It will therefore behave more portably between operating systems than g.;The return codes and possible failures are the same as for g.Yprocess Filename of the executable (see  for details)process any argumentsprocessstandard inputprocessstdoutZprocessstandard inputprocessstdout[process Filename of the executable (see  for details)process any argumentsprocessstandard inputprocessexitcode, stdout, stderr\processstandard inputprocessexitcode, stdout, stderrdprocess Filename of the executable (see  for details)process#Arguments to pass to the executableprocess&Optional path to the working directoryprocess(Optional environment (otherwise inherit)processHandle to use for stdin (Nothing => use existing stdin)processHandle to use for stdout (Nothing => use existing stdout)processHandle to use for stderr (Nothing => use existing stderr)fprocess Filename of the executable (see  for details)process#Arguments to pass to the executableprocess&Optional path to the working directoryprocess(Optional environment (otherwise inherit)8R=QP !"#$%&'()*+,-./WXUVZY\[ST]O^_`abCABdcfegh8R=QP !"#$%&'()*+,-./WXUVZY\[ST]O^_`abCABdcfegh Safe-Inferredhiprocess Turn the F into a / that can be read from in the current process.jprocess Turn the F into a 0 that can be written to in the current process.kprocessCreate a pipe (weRead,theyWrite) that the current process can read from, and whose write end can be passed to a child process in order to receive data from it.See F.lprocessCreate a pipe (theyRead,weWrite) that the current process can write to, and whose read end can be passed to a child process in order to send data to it.See F.mprocess A version of readCreateProcessWithExitCode= that communicates with the child process through a pair of Fs.Example usage: readCreateProcessWithExitCodeCommunicationHandle (\(chTheyRead, chTheyWrite) -> proc "child-exe" [show chTheyRead, show chTheyWrite]) (\ hWeRead -> hGetContents hWeRead) (\ hWeWrite -> hPut hWeWrite "xyz")where  child-exe1 is a separate executable that is implemented as: main = do [chRead, chWrite] <- getArgs hRead <- openCommunicationHandleRead $ read chRead hWrite <- openCommunicationHandleWrite $ read chWrite input <- hGetContents hRead hPut hWrite $ someFn input hClose hWritemprocessProcess to spawn, given a  (read, write) pair of F+s that are inherited by the spawned processprocess read actionprocess write actionFijIklmFijIklm "(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportableSafehghgh     !"#$%&'()**+,-.//0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUUVWXYZ[\]^_ `abcdefghijklmnopqrstuvwxy z{ |}~              |&process-1.6.20.0-1iEEn8zQcbAoxnWTPyBXbSystem.Process.InternalsSystem.Process+System.Process.CommunicationHandle.Internal"System.Process.CommunicationHandleprocessSystem.Process.CommonwaitForProcessSystem.Process.Posix createProcessSystem.IO.Error IOErrorType System.CmdbaseSystem.Posix.TypesGroupIDUserIDCGidGHC.IO.Handle.FD fdToHandle unix-2.8.1.0System.Posix.Process.Internals c_execvpepPrPr_disableITimers ProcessHandlephandlemb_delegate_ctlc waitpidLockProcessHandle__ OpenHandle OpenExtHandle ClosedHandlephdlProcessHandle phdlJobHandle StdStreamInherit UseHandle CreatePipeNoStreamCmdSpec ShellCommand RawCommandProcRetHandles hStdInput hStdOutput hStdError procHandle CreateProcesscmdspeccwdenvstd_instd_outstd_err close_fds create_group delegate_ctlcdetach_consolecreate_new_console new_session child_group child_useruse_process_jobsPHANDLEwithFilePathExceptionmodifyProcessHandlewithProcessHandlemkProcessHandle closePHANDLEwithCEnvironmentrunInteractiveProcess_lockstartDelegateControlCstopDelegateControlCendDelegateControlC ignoreSignal defaultSignalcreateProcess_ translate unwrapHandlesrunGenProcess_ createPipe createPipeFdinterruptProcessGroupOf withForkWait ignoreSigPipeCommunicationHandleuseCommunicationHandlecloseCommunicationHandlecreateCommunicationPipe$fReadCommunicationHandle$fShowCommunicationHandle$fEqCommunicationHandle$fOrdCommunicationHandlePidprocshellwithCreateProcesscleanupProcess spawnProcess spawnCommand callProcess callCommand readProcessreadCreateProcessreadProcessWithExitCodereadCreateProcessWithExitCodeshowCommandForUsergetPid getCurrentPidgetProcessExitCodeterminateProcess runCommand runProcessrunInteractiveCommandrunInteractiveProcesssystem rawSystemopenCommunicationHandleReadopenCommunicationHandleWritecreateWeReadTheyWritePipecreateTheyReadWeWritePipe0readCreateProcessWithExitCodeCommunicationHandleGHC.IOFilePath GHC.MaybeNothing$fIsStringCmdSpecfd_stdin fd_stdout fd_stderrmbFdmbPipe pfdToHandle rawFdToHandlecommandToProcessinterruptProcessGroupOfInternaltranslateInternalcreateProcess_InternalisDefaultSignalcreatePipeInternalcreatePipeInternalFdGHC.IO.Handle.TypesHandleSystem.Posix.InternalsFDGHC.BaseStringGHC.ShowShowGHC.ReadReadid GHC.IO.HandlehSetBinaryModeControl.Exception.Basebracket GHC.Conc.Sync killThreadGHC.IO.ExceptionIOErrorExitCode ExitSuccessSystem.Posix.Process.Common getProcessID ExitFailureJustghc-prim GHC.TypesTrueFalse