aha! file descriptor leak in 'readFile'
John Meacham
john at repetae.net
Mon Apr 19 01:32:15 EDT 2004
I have finally tracked down a test case which results in the file
descriptor leak which has plauged one of my programs since its birth.
this code:
sequence (replicate 100 $ handle (\_ -> return "") ( readFile "."))
will leak 100 file descriptors, apparently, after a
Fail: .: openFile: inappropriate type (is a directory)
exception from readFile, the file descriptor will not be closed, and
instead be left open til the end o' time.
it took me a long time to find because I thought the bug was in
the listing of my directories, not the readFile's of its contents
(including "." and "..").
John
--
John Meacham - ⑆repetae.net⑆john⑈
More information about the Libraries
mailing list