Module fs/walker
fs/walker
Recursive directory traversal.
Example
{ walk, WalkEntry } :: import "std/fs/walker";
main :: (fn(io : Io, exn : Exception) -> unit)({
entries := io.await(walk(Path.new(`/tmp`), io), { io, exn });
i := usize(0);
while runtime((i < entries.len())), {
e := entries(i);
println(e.path);
i = (i + usize(1));
};
});
Types
WalkEntry
struct
WalkOptions
struct
WalkOptions
Options controlling directory walk behavior.
Fields
| Name | Type | Description |
|---|---|---|
max_depth | Option(u32) | |
follow_symlinks | bool | |
include_dirs | bool |
impl(WalkOptions, ...)
defaults : (WalkOptions) fn() -> WalkOptionsReturns: WalkOptions
Functions
walk
function
walk_cstr
function
walk_with
function
walk_with_cstr
function
fn(root : *(u8), options : WalkOptions, io : Io) -> Impl(Future(ArrayList(WalkEntry), IoExn))
Parameters
| Name | Type | Notes |
|---|---|---|
root | *(u8) | |
options | WalkOptions | |
io | Io |