OxL Reference

data DirEntry

One entry of a directory listing: name is relative to the listed directory (walk gives sub/dir/name).

Example:

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

fn main() io {
  let dir = fs.tempDir()!
  for e in fs.list(dir)! {
    print(e.name)
  }
  print("empty directory listed")
  fs.removeAll(dir)!
}
Output
empty directory listed
@derive(Eq)
pub(api) data DirEntry

Since. 1.0.0-beta

Fields

pub(api) name: str

Name relative to the listed directory.

pub(api) kind: FileKind

What the entry is.

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

See also