separate readDir, avoid fs.stat() in two places