Skip to main content

has_attribute

Function has_attribute 

Source
pub fn has_attribute(file: &Path, attrib: Attributes) -> bool
Expand description

Check if a file has a certain attribute.

§Params

file: &Path -> The path to the file.
attrib: Attributes -> The attribute to check for.

§Returns

If the file has the specified attribute.

§Examples

use std::path::Path;
use system_extensions::metadata::attribute::{has_attribute, Attributes};

has_attribute(Path::new("/test.txt"), Attributes::HIDDEN);