aha! file descriptor leak in 'readFile'

19 Apr
2004
19 Apr
'04
3:32 a.m.
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⑈
7701
Age (days ago)
7701
Last active (days ago)
0 comments
1 participants
participants (1)
-
John Meacham