fswalk

Types

Data about the file/folder walked.

pub type Entry {
  Entry(filename: String, stat: Stat)
}

Constructors

  • Entry(filename: String, stat: Stat)

A function that filters entries in the walk iterator.

pub type EntryFilter =
  fn(Entry) -> Bool

Incomplete stat data.

pub type Stat {
  Stat(is_directory: Bool)
}

Constructors

  • Stat(is_directory: Bool)

See builder.

pub opaque type WalkBuilder(traversal_filter, path)

Functions

pub fn builder() -> WalkBuilder(Non, Non)

Create a new WalkBuilder

pub fn walk(
  builder: WalkBuilder(a, Som),
) -> Iterator(Result(Entry, FileError))

Walks the filesystem lazily.

pub fn with_path(
  builder: WalkBuilder(a, b),
  path: String,
) -> WalkBuilder(a, Som)

Create a new WalkBuilder bound to a directory path to walk

pub fn with_traversal_filter(
  builder: WalkBuilder(a, b),
  traversal_filter: fn(Entry) -> Bool,
) -> WalkBuilder(Som, b)

Create a new WalkBuilder adding an additional entry filter function.

Search Document