method File.stat
Like metadata, following symbolic links.
Example:
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 ioSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
path | str |
Returns
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