Have you tried testing the return value of closedir? If it reports a failure, that is probably indicative of a failure in the readdir call. Of course, I don't have a good way of testing this, either.
Also, it is good practice to use a lexically scoped variable for the directory handle rather than a bare word.
In reply to Re: Testing for readdir failure
by eye
in thread Testing for readdir failure
by Bob Cook
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |