add readdir for linux and windows