OxL Reference

method File.chmod

Replaces the permission bits (File.chmod(path, 0o600)).

Example:

oxl✓ checked in CI
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  io

Since. 1.0.0-beta

Parameters

NameType
pathstr
modeu32

Returns

()

Errors

  • IoError @error
  • `IoError` (`NotFound`, `PermissionDenied`).

Effects

io

Defined in: std/io/io.oxl:498

See also