[][src]Trait openat_ext::OpenatDirExt

pub trait OpenatDirExt {
    fn open_file_optional<P: AsPath>(&self, p: P) -> Result<Option<File>>;
fn get_file_type(&self, e: &Entry) -> Result<SimpleType>; }

Helper functions for openat::Dir

Required methods

fn open_file_optional<P: AsPath>(&self, p: P) -> Result<Option<File>>

Checking for nonexistent files (ENOENT) is by far the most common case of inspecting error codes in Unix. Rust has a nice Option<> type, so this helper makes use of it and returns Ok(None) for nonexistent files. All other errors are Err, and extant files are Ok(Some<file>)) of course.

fn get_file_type(&self, e: &Entry) -> Result<SimpleType>

On modern filesystems the directory entry contains the type; if available, return it. Otherwise invoke stat().

Loading content...

Implementations on Foreign Types

impl OpenatDirExt for Dir[src]

Loading content...

Implementors

Loading content...