Skip to main content

directory_exists

Function directory_exists 

Source
pub fn directory_exists(path: impl AsRef<Path>) -> bool
Expand description

Returns true if path exists and is a directory.

Uses std::fs::metadata (follows symlinks). Permission errors and missing paths yield false — this is a convenience wrapper, not a strict probe.

Equivalent in intent to:

path.is_dir()
    || fs::metadata(path).map(|m| m.is_dir()).unwrap_or(false)

§Filesystem access

Yes. Follows symlinks. Does not populate a cache.

Prefer inspect_directory when you need error context.