anoia fs.dir use case not match

match was accidentally pinning the return from readdir against the
function parameter. Which didn't work.
This commit is contained in:
Daniel Barlow 2024-07-26 23:37:40 +01:00
parent 70ca7fac17
commit d300373b96
1 changed files with 4 additions and 3 deletions

View File

@ -38,9 +38,10 @@
(fn dir [name]
(let [dp (assert (ll.opendir name) name)]
(fn []
(match (ll.readdir dp)
(name type) (values name type)
(nil err) (do (if err (print err)) (ll.closedir dp) nil)))))
(case (ll.readdir dp)
(name filetype) (values name filetype)
(nil err) (do (if (> err 0) (print "ERR" err)) (ll.closedir dp) nil)
))))
(fn rmtree [pathname]
(case (file-type pathname)