Apparently on some versions of OS X, once readdir returns nil once, it automatically rewinds and starts reading from the beginning of the directory. U9fs has always assumed that once you hit the end of the directory, readdir will repeatedly return nil (at least twice). Remove this assumption.