So, do you ever get the message that says :
"Still opening a file what to do?"
Because that looks like a self-avowed filehandle-leak and thread-leak bug (both at once). If there is not this message anywhere, then it looks like there is another bug on top of that. But I don't really know enough to be able to help here.
It would actually help a lot, if August stepped in.
Thanks for looking into that. The message itself is does give the impression of a filehandle or thread-leak....however, I do believe I cover it all just a few lines down when I join the thread and close out the files.
It should be irrelevant to the current "Too many open files" bug report, but I have cleaned it up now so that it at least reads better.