OxL Reference

method File.stat

Like metadata, following symbolic links.

Example:

oxl✓ checked in CI
use std.io { File, Metadata }

fn main() io {
  match File.stat("/definitely/missing") {
    Metadata _ => print("exists")
    IoError e => print("{e.kind == IoErrorKind.NotFound}")
  }
}
Output
true
pub(api) static fn stat(path: str) -> Metadata | IoError  io

Since. 1.0.0-beta

Parameters

NameType
pathstr

Returns

Metadata

Errors

  • IoError @error
  • `IoError` (`NotFound` when the path or the target of a link does not exist).

Effects

io

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

See also