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}")
}
}Вывод
true
pub(api) static fn stat(path: str) -> Metadata | IoError ioС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
path | str |
Возвращает
Ошибки
IoError@error- `IoError` (`NotFound` when the path or the target of a link does not exist).
Эффекты
io
Определено в: std/io/io.oxl:478