API Reference › Fs › Fs.list
method

Fs.list

Fs.list(dir) -> []string

Returns the names of the entries in a directory (excluding . and ..), sorted ascending for a stable, reproducible order — important for deterministic mod loading. Names are relative; combine with Path.join for full paths.

Parameters

dirthe directory to list

Example

program List {
  entry {
    let names = Fs.list("mods")
    var i = 0
    while i < len(names) { print(len(names[i])); i = i + 1 }
  }
}
← All symbols