API Reference › Fs › Fs.size
method

Fs.size

Fs.size(p) -> int

Returns the size of a file in bytes, or -1 if it cannot be opened. Useful for progress bars or sanity checks before loading.

Parameters

pthe path

Example

program Size {
  entry {
    let n = Fs.size("assets/level1.dat")
    if n >= 0 { print(n) }
  }
}
← All symbols