summaryrefslogtreecommitdiff
path: root/test/test.rs
diff options
context:
space:
mode:
authorScott Lamb <slamb@slamb.org>2018-06-07 13:18:14 -0700
committerScott Lamb <slamb@slamb.org>2018-09-03 17:04:57 -0700
commitf9ebcb7c00faf1290565630f14c93a9c7ab51e51 (patch)
tree85fd74027d129c4a46aa9af247a9fb130cccd141 /test/test.rs
parent82b51a2b5dd9b5567d4cf15f4bf931d9e39528d1 (diff)
downloadnix-f9ebcb7c00faf1290565630f14c93a9c7ab51e51.zip
new dir module
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).
Diffstat (limited to 'test/test.rs')
-rw-r--r--test/test.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/test.rs b/test/test.rs
index da55235a..a72dc44a 100644
--- a/test/test.rs
+++ b/test/test.rs
@@ -10,6 +10,7 @@ extern crate rand;
extern crate tempfile;
mod sys;
+mod test_dir;
mod test_fcntl;
#[cfg(any(target_os = "dragonfly",
target_os = "freebsd",