I'm not %100 sure about this, but I suspect that
readdir is working like the file read operators.
You can't re-read a file from the
same handle again until you rewind it.
Even if you could, since you're program is trying to
"look for new files" you'll probably have to close and
re-open the dir handle on each loop.
I dont think there is a way to rewind directory handles
(you can rewind most filehandles with seek).