OxL Reference

method fs.walk

All descendants, sorted by relative path; symbolic links are listed, not followed.

Example:

oxl✓ checked in CI
use std.io { File, fs }

fn main() io {
  let dir = fs.tempDir()!
  fs.createDirAll("{dir}/x/y")!
  File.writeText("{dir}/x/y/f", "")!
  print("{fs.walk(dir)!.len()}")
  fs.removeAll(dir)!
}
Output
3
pub(api) static fn walk(path: str) -> List<DirEntry> | IoError  io

Since. 1.0.0-beta

Parameters

NameType
pathstr

Returns

List<DirEntry>

Errors

Effects

io

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

See also