[Haskell-cafe] No handles from createProcess

Brandon Allbery allbery.b at gmail.com
Mon Dec 15 16:23:49 UTC 2014


On Mon, Dec 15, 2014 at 9:11 AM, Henk-Jan van Tuyl <hjgtuyl at chello.nl>
wrote:
>
> I am experimenting with the createProcess function from the package
> "process"; this function does not return any handle, on both Ubuntu and
> Windows. I am doing something wrong, or is this a bug? (I am using GHC
> 7.8.3 on both platforms.)
>

Not a bug; you need to tell it which ones to create handles for.

createProcess
> <http://lambda.haskell.org/platform/doc/current/ghc-doc/libraries/process-1.1.0.2/System-Process.html#v:createProcess>
>  returns (mb_stdin_hdl, mb_stdout_hdl, mb_stderr_hdl, p), where
>
>    - if std_in == CreatePipe, 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 == Nothing
>
> Similarly for mb_stdout_hdl and mb_stderr_hdl.
>

The default action is to inherit the existing handles for stdin/out/err in
the subprocess and provide no handles to the caller; this mirrors the
default behavior of creating a new process on Windows and POSIX.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141215/2a458a2c/attachment.html>


More information about the Haskell-Cafe mailing list