8000 GitHub - mdarse/fswalk: recursively walk the filesystem
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ fswalk Public
forked from cdaringe/fswalk

recursively walk the filesystem

Notifications You must be signed in to change notification settings

mdarse/fswalk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fswalk

Recursively walk the filesystem starting from the provided path.

Package Version Hex Docs

gleam add fswalk
import fswalk

pub fn main() {
  fswalk.builder()
  |> fswalk.with_path("test/fixture")
  |> fswalk.with_traversal_filter(fn(entry) {
    !string.contains(does: entry.filename, contain: "ignore_folder")
  })
  |> fswalk.walk
  |> iterator.fold([], fn(acc, it) {
    case it {
      Ok(entry) if !entry.stat.is_directory -> [entry.filename, ..acc]
      _ -> acc
    }
  })
  |> should.equal(["test/fixture/b/c/d", "test/fixture/a"])
}

Further documentation can be found at https://hexdocs.pm/fswalk.

Development

gleam run   # Run the project
gleam test  # Run the tests

changelog

  • 1.0.0 - init
  • 2.0.0 - support traverse filtering in tandem with entry filtering
  • 3.0.0
    • dropped .with_entry_filter. Use iterator.* functions on the output instead.
    • dropped sugar functions .map/.each/.fold. Use iterator.* functions on the output instead.

About

recursively walk the filesystem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Gleam 100.0%
0