I don't think this is new, but I feel it is a ghc bug.
Please correct me if I'm wrong. I do:
% cat > manyfiles.hs
main :: IO ()
main =
do
readFile "manyfiles.hs"
main
% ghc -o manyfiles manyfiles.hs
% ./manyfiles
Fail: resource exhausted
Action: openFile
Reason: process file table full
File: manyfiles.hs
In fact nhc98 behaves the same, but hugs seems to do better
and just keeps opening and closing the file handles (in
blocks of 37 apparently).
IMHO hugs is doing the right thing here. Shouldn't ghc also
close semiclosed handles when all references to them have
been dropped? This makes lazy reading much more meaningful.
At the moment in my programs that do a lot of repetitive
lazy reading, I have to go out of my way to make sure that I
read from a handle ALL the way to the end to make sure that
the handle gets closed properly. But I feel this is really
a dirty hack, and that the handle should just close
automagically when there are no references to it left in
scope.
I don't know if threading is an issue here, but I hope I'm
not overlooking something obvious.
Cheers, Jens
ps I'm using the following rpm's (ia32/Linux):
ghc-5.00.2-1
nhc98-1.02-1
Hugs98-Feb2000-1cl
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs