permissions

Crates.iopermissions
lib.rspermissions
version0.5.1
sourcesrc
created_at2020-09-22 05:30:06.531273
updated_at2023-09-04 18:33:10.912343
descriptionLibrary to query for file permissions (read, write, execute, removal and creation).
homepage
repositoryhttps://github.com/marcospb19/permissions
max_upload_size
id291407
size15,288
João Marcos (marcospb19)

documentation

README

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.
Commit count: 73

cargo fmt