Exacl   ![CRATE] ![CI] ![API]

Rust library to manipulate file system access control lists (ACL) on macOS and Linux.

Example

```rust use exacl::{getfacl, setfacl, AclEntry, Perm};

// Get the ACL from "./tmp/foo". let mut acl = getfacl("./tmp/foo", None)?;

// Print the contents of the ACL. for entry in &acl { println!("{}", entry); }

// Add an ACL entry to the end. acl.push(AclEntry::allowuser("someuser", Perm::READ, None));

// Sort the ACL in canonical order. acl.sort();

// Set the ACL for "./tmp/foo". setfacl(&["./tmp/foo"], &acl, None)?; ```

High Level API

This module provides two high level functions, getfacl and setfacl.

On Linux, the ACL contains entries for the default ACL, if present.

Both getfacl and setfacl work with a Vec<AclEntry>. The AclEntry structure contains five fields:

AclEntry supports an ordering that corresponds to ACL canonical order. An ACL in canonical order has deny entries first, and inherited entries last. On Linux, entries for file-owner sort before named users. You can sort a vector of AclEntry to put the ACL in canonical order.

Low Level API

The low level API is appropriate if you need finer grained control over the ACL.

The low level API uses the Acl class which wraps the native ACL object. Each Acl is immutable once constructed. To manipulate its contents, you can retrieve a mutable vector of AclEntry, modify the vector's contents, then create a new Acl.