Re: [Haskell-cafe] createProcess shutting file handles

2009-02-16 Thread Simon Marlow
Neil Mitchell wrote: Hi However the createProcess command structure has the close_fds flag, which seems like it should override that behaviour, and therefore this seems like a bug in createProcess. close_fds :: Bool Close all file descriptors except stdin, stdout and stderr

Re: [Haskell-cafe] createProcess shutting file handles

2009-02-16 Thread Neil Mitchell
However the createProcess command structure has the close_fds flag, which seems like it should override that behaviour, and therefore this seems like a bug in createProcess. close_fds :: Bool Close all file descriptors except stdin, stdout and stderr in the new process

Re: [Haskell-cafe] createProcess shutting file handles

2009-02-15 Thread Neil Mitchell
Hi What have I done wrong? Did createProcess close the handle, and is there a way round this? The docs for runProcess says: Any Handles passed to runProcess are placed immediately in the closed state. but the equivalent seems to be missing from the documentation for

Re: [Haskell-cafe] createProcess shutting file handles

2009-02-15 Thread Duncan Coutts
On Sun, 2009-02-15 at 09:24 +, Neil Mitchell wrote: Hi What have I done wrong? Did createProcess close the handle, and is there a way round this? The docs for runProcess says: Any Handles passed to runProcess are placed immediately in the closed state. but

Re: [Haskell-cafe] createProcess shutting file handles

2009-02-15 Thread Duncan Coutts
On Sun, 2009-02-15 at 11:06 +, Duncan Coutts wrote: On Sun, 2009-02-15 at 09:24 +, Neil Mitchell wrote: Hi What have I done wrong? Did createProcess close the handle, and is there a way round this? The docs for runProcess says: Any Handles passed to

Re: [Haskell-cafe] createProcess shutting file handles

2009-02-15 Thread Neil Mitchell
Hi However the createProcess command structure has the close_fds flag, which seems like it should override that behaviour, and therefore this seems like a bug in createProcess. close_fds :: Bool Close all file descriptors except stdin, stdout and stderr in the

[Haskell-cafe] createProcess shutting file handles

2009-02-13 Thread Neil Mitchell
Hi, I want to run multiple programs and dump the stdout/stderr to a file, I've tried doing: h - openFile file WriteMode let c = CreateProcess (RawCommand file []) Nothing Nothing Inherit (UseHandle h) (UseHandle h) False (_,_,_,pid)

Re: [Haskell-cafe] createProcess shutting file handles

2009-02-13 Thread Jeremy Shaw
Hello, As far as I can tell, createProcess is closing the handle: createProcess :: CreateProcess - IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) createProcess cp = do r - runGenProcess_ runGenProcess cp Nothing Nothing maybeCloseStd (std_in cp) maybeCloseStd (std_out

Re: [Haskell-cafe] createProcess shutting file handles

2009-02-13 Thread Duncan Coutts
On Fri, 2009-02-13 at 15:38 +, Neil Mitchell wrote: What have I done wrong? Did createProcess close the handle, and is there a way round this? The docs for runProcess says: Any Handles passed to runProcess are placed immediately in the closed state. but the equivalent