summaryrefslogtreecommitdiff
path: root/src/lib.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 /src/lib.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 'src/lib.rs')
-rw-r--r--src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 07e84c12..ed96a8e1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -29,6 +29,7 @@ pub extern crate libc;
#[macro_use] mod macros;
// Public crates
+pub mod dir;
pub mod errno;
#[deny(missing_docs)]
pub mod features;