#file-permissions #read-write #file

permissions

Library to query for file permissions (read, write, execute, removal and creation)

8 releases (4 breaking)

0.5.1 Sep 4, 2023
0.4.1 Nov 18, 2022
0.3.0 Mar 4, 2021
0.2.1 Apr 25, 2022
0.0.1 Sep 22, 2020

#437 in Filesystem

Download history 377/week @ 2024-07-30 556/week @ 2024-08-06 765/week @ 2024-08-13 834/week @ 2024-08-20 843/week @ 2024-08-27 1310/week @ 2024-09-03 777/week @ 2024-09-10 787/week @ 2024-09-17 543/week @ 2024-09-24 396/week @ 2024-10-01 333/week @ 2024-10-08 327/week @ 2024-10-15 294/week @ 2024-10-22 345/week @ 2024-10-29 424/week @ 2024-11-05 686/week @ 2024-11-12

1,787 downloads per month
Used in 9 crates (6 directly)

MIT license

13KB
72 lines

NOTE

If you want Windows support, check faccess instead.

permissions

Crates.io License Docs.rs

Useful filesystem queries for file permissions:

See functions.

Examples:

use permissions::*;

fn main() -> std::io::Result<()> {
   // Functions accept `AsRef<Path>`
   assert!(is_readable("src/")?);
   assert!(is_writable("src/")?);
   assert!(is_writable("src/lib.rs")?);
   assert!(is_executable("/usr/bin/cat")?);
   assert!(is_removable("src/lib.rs")?);
   assert!(is_creatable("src/file.rs")?);

   Ok(())
}

Alternatives

  • faccess - it provides Windows support and a trait-based API.

Dependencies

~44KB