|
This is a lower-level interface than `std::fs::ReadDir`. Notable differences:
* can be opened from a file descriptor (as returned by `openat`, perhaps
before knowing if the path represents a file or directory). Uses
`fdopendir` for this, available on all Unix platforms as of
rust-lang/libc#1018.
* implements `AsRawFd`, so it can be passed to `fstat`, `openat`, etc.
* can be iterated through multiple times without closing and reopening the
file descriptor. Each iteration rewinds when finished.
* returns entries for `.` (current directory) and `..` (parent directory).
* returns entries' names as a `CStr` (no allocation or conversion beyond
whatever libc does).
|