Crate xattr[][src]

A pure-Rust library to manage extended attributes.

It provides support for manipulating extended attributes (xattrs) on modern Unix filesystems. See the attr(5) manpage for more details.

An extension trait FileExt is provided to directly work with standard File objects and file descriptors.

NOTE: In case of a symlink as path argument, all methods in this library work on the symlink itself without de-referencing it.

let mut xattrs = xattr::list("/").unwrap().peekable();

if xattrs.peek().is_none() {
    println!("no xattr set on root");
    return;
}

println!("Extended attributes:");
for attr in xattrs {
    println!(" - {:?}", attr);
}

Structs

UnsupportedPlatformError

The error type returned on unsupported platforms.

XAttrs

An iterator over a set of extended attributes names.

Constants

SUPPORTED_PLATFORM

A constant indicating whether or not the target platform is supported.

Traits

FileExt

Extension trait to manipulate extended attributes on File-like objects.

Functions

get

Get an extended attribute for the specified file.

list

List extended attributes attached to the specified file.

remove

Remove an extended attribute from the specified file.

set

Set an extended attribute on the specified file.