[ ghc-Bugs-1187302 ] runProcess doesn't close handles?

SourceForge.net noreply at sourceforge.net
Wed Jul 6 08:15:54 EDT 2005


Bugs item #1187302, was opened at 2005-04-21 11:24
Message generated for change (Comment added) made by simonmar
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1187302&group_id=8032

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libraries/base
Group: 6.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Roman Leshchinskiy (romanle)
Assigned to: Simon Marlow (simonmar)
Summary: runProcess doesn't close handles?

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Simon Marlow (simonmar)
Date: 2005-07-06 12:15

Message:
Logged In: YES 
user_id=48280

Fixed, thanks.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1187302&group_id=8032



More information about the Glasgow-haskell-bugs mailing list