logo       

[ ghc-Bugs-1187302 ] runProcess doesn't close handles?: msg#00101

lang.haskell.glasgow.bugs

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

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

Category: libraries/base
Group: 6.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Roman Leshchinskiy (romanle)
Assigned to: Nobody/Anonymous (nobody)
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.

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

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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise