in reply to Re: Rename All Files In a Directory
in thread Rename All Files In a Directory

Good catch! This is the most reasonable guess so far. I didn't know that failing to closedir may have this side effect. But then I rarely explicitly myself.