Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Because you get an iterator over `struct dirent`, which includes `d_type` for popular filesystems.

Notice that this avoids `lstat` calls; for symlinks you may still need to do a stat call if you want to stat the target.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: