method File.chmod
Replaces the permission bits (File.chmod(path, 0o600)).
Example:
use std.io { File }
fn main() io {
let path = "/tmp/oxl_doc_chmod.txt"
File.writeText(path, "x")!
File.chmod(path, 0o600)!
print("{File.metadata(path)!.mode & 0o777}")
File.remove(path)!
}Output
384
pub(api) static fn chmod(path: str, mode: u32) -> () | IoError ioSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
path | str |
mode | u32 |
Returns
()
Errors
IoError@error- `IoError` (`NotFound`, `PermissionDenied`).
Effects
io
Defined in: std/io/io.oxl:498