id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
362,runProcess doesn't close handles?,romanle,simonmar,"{{{
The documentation for runProcess says: ""Any Handles
passed to runProcess are placed immediately in the
closed state, so may no longer be referenced by the
Haskell process."" But

test =
  do
    h <- openFile ""output"" WriteMode
    ph <- runProcess ""/bin/ls"" [] Nothing Nothing
              Nothing (Just h) Nothing
    waitForProcess ph

main = test >> test >> return ()

aborts with ""output: openFile: resource busy (file is
locked)"" on the second call to test whereas 

test =
  do
    h <- openFile ""output"" WriteMode
    ph <- runProcess ""/bin/ls"" [] Nothing Nothing
              Nothing (Just h) Nothing
    hClose h
    waitForProcess ph

main = test >> test >> return ()

works fine.
}}}",bug,closed,normal,,libraries/base,6.4,Fixed,,,,,,,,,,
