Would be nice to have `readdir()` support `d_type` so that it is possible to distinguish between files and directories in a portable way.