in reply to readdir inconsistent!

Have you tried sorting and comparing your outputs from different runs to see if knowing what the actual differences are sheds any light?