data Metadata
Size, kind and times of a file system entry.
Example:
use std.io { File }
fn main() io {
let path = "/tmp/oxl_doc_meta_example.txt"
File.writeText(path, "12345")!
let m = File.metadata(path)!
print("{m.size} {m.isFile()}")
File.remove(path)!
}Вывод
5 true
pub(api) data MetadataС версии. 1.0.0-beta
Поля
pub(api) kind: FileKind | What the entry is. |
pub(api) size: u64 | Size in bytes (for a directory: whatever the file system reports). |
pub(api) modified: Time | Last modification, UTC. |
pub(api) mode: u32 | Permission bits ( |
Методы
isFile | () -> boolWhether the entry is a regular file. |
isDir | () -> boolWhether the entry is a directory. |
isSymlink | () -> boolWhether the entry is a symbolic link (metadata does not follow links, stat does). |
Определено в: std/io/io.oxl:113