liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit d300373b96ca5ee5fcf45a20ee1a2f2daea350c5
parent 70ca7fac17bcc7cbdd4f5d973b9dd7123a8f344d
Author: Daniel Barlow <dan@telent.net>
Date:   Fri, 26 Jul 2024 23:37:40 +0100

anoia fs.dir use case not match

match was accidentally pinning the return from readdir against the
function parameter. Which didn't work.

Diffstat:
Mpkgs/anoia/fs.fnl | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/pkgs/anoia/fs.fnl b/pkgs/anoia/fs.fnl @@ -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)