15 releases

Uses old Rust 2015

0.2.2 Jul 6, 2018
0.2.1 Jul 21, 2017
0.1.11 Feb 27, 2017
0.1.10 Aug 23, 2016
0.1.2 Jul 10, 2015

#75 in Filesystem

Download history 22311/week @ 2020-12-24 33574/week @ 2020-12-31 42588/week @ 2021-01-07 39736/week @ 2021-01-14 39178/week @ 2021-01-21 39621/week @ 2021-01-28 40478/week @ 2021-02-04 41916/week @ 2021-02-11 44278/week @ 2021-02-18 46203/week @ 2021-02-25 48509/week @ 2021-03-04 59369/week @ 2021-03-11 51006/week @ 2021-03-18 57627/week @ 2021-03-25 50730/week @ 2021-04-01 61583/week @ 2021-04-08

166,003 downloads per month
Used in 587 crates (11 directly)

MIT/Apache

30KB
852 lines

xattr

Build Status

A small library for setting, getting, and listing extended attributes.

Supported Platforms: Linux, MacOS, FreeBSD, and NetBSD.

API Documentation: https://stebalien.github.com/xattr/xattr/

Unsupported Platforms

This library includes no-op support for unsupported platforms. That is, it will build on all platforms but always fail on unsupported platforms.

  1. You can turn this off by disabling the default unsupported feature. If you do so, this library will fail to compile on unsupported platforms.
  2. Alternatively, you can detect unsupported platforms at runtime by checking the xattr::SUPPORTED_PLATFORM boolean.

lib.rs:

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);
}

Dependencies