I've not looked at the source code, but ...

You could cache the file handle and only close it when the dir changes? You could simply save the path string and then compare it when the path is changed...

Anyway, this means the only way for me to deal with this is to close the
directory EVERY time right after I open it. But it's not ideal for the
design of this object, where I wanted it to leave the directory open so we
could keep querying for files without the need to reopen it every time. I
guess I can just deal with this by opening/closing all the time, but it
kinda sucks... Unless the wizards out there have a magical way out for me
:)

--------
Dan Wilcox
@danomatika
danomatika.com
robotcowboy.com