io.readdir (dir-marked + callback-directed + recursive)
io exposes stat (kind incl. "dir") but no way to LIST a directory, so a JS utility cannot walk a tree, glob, or scan a worktree. The abc leaf already exists. Method: Issues.
js/io.cpp has open/close/stat/read/write/mmap but no listing
(verified: grep readdir/scandir in io.cpp → none).
abc/FILE.h:242 FILEScanDir(path8bp, path8f, void0p) already wraps thesyscall — a bindable leaf, no new abc work.
be status review: the worktree scan, any require-style resolver, and most CLI tools need a dir listing.
io.readdir(path) → string[], one level, **dirs marked with a trailing
/**; hidden (dot) entries skipped by default.
("more"/"enough"/"recur"); an OBJECT is options.
{recursive, callback, hidden}: recursive:true auto-descends
(flat array, or cb per entry); callback:fn = the directed cb; hidden:true includes dotfiles (default skip).
FILEScanDir / FILEDeepScanDir (`path8f = ok64(*)(void0p,
path8p)); a C trampoline runs cb synchronously in-frame, never stashed (rule #4); a cb` throw aborts + propagates.
typeof === "function" → callback form; an object →
options (with optional callback). recursive:true uses FILEDeepScanDir; a per-entry "recur" (non-recursive) nests FILEScanDir.
hidden:false (default) skips basenames starting . (./.. already
dropped by FILEScan). Dir-ness from the trailing / per entry. No ptr arith.
(nothing | callback fn | options object) before landing.
{recursive, callback, hidden} is the superset; bare-fn is sugar for
{callback:fn}. Emitted paths stay root-relative (cb sees sub/child).
marking, enough early-stop, recur/recursive reach the child, and hidden default-skips the dotfile (present when hidden:true). Red→green.
60194418 (2026-06-21): polymorphic io.readdir(path, arg) —
absent → 1-level string[] (dirs marked /, dotfiles skipped); a function → directed cb (more/enough/recur); an object {recursive, callback, hidden} → superset (recursive→FILEDeepScanDir; hidden:false prunes dotfiles + hidden dirs via FILESKIP; recur no-op under recursive). 19 rows red→green; ctest -R JABC 18/18, ASAN/LSan clean; --force past the benign INDEX.md marker.