Permissions in async_std::fs - Rust (original) (raw)
pub struct Permissions { /* private fields */ }
Expand description
Returns the read-only flag.
§Examples
use async_std::fs;
let perm = fs::metadata("a.txt").await?.permissions();
println!("{:?}", perm.readonly());
Configures the read-only flag.
§Examples
use async_std::fs;
let mut perm = fs::metadata("a.txt").await?.permissions();
perm.set_readonly(true);
fs::set_permissions("a.txt", perm).await?;
Tests for self
and other
values to be equal, and is used by ==
.
Tests for !=
. The default implementation is almost always sufficient, and should not be overridden without very good reason.