Function rood::sys::file::ensure_exists[][src]

pub fn ensure_exists<T>(raw: T) -> Result<()> where
    T: AsRef<Path>, 

Checks for existence of the provided path, returning an error in case it doesn't exist.

Mostly a convenient wrapper for spawning consistent Error instances when checking for path existence.

Examples

use rood::sys::file;
let result = file::ensure_exists("/non_existent_file.txt");
assert!(result.is_err());