OxL Reference

data Metadata

Size, kind and times of a file system entry.

Example:

oxl✓ checked in CI
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)!
}
Output
5 true
pub(api) data Metadata

Since. 1.0.0-beta

Fields

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 (0o644 = 420).

Methods

isFile() -> bool
Whether the entry is a regular file.
isDir() -> bool
Whether the entry is a directory.
isSymlink() -> bool
Whether the entry is a symbolic link (metadata does not follow links, stat does).

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

See also