From 1629429d63170b1c5a19e72e838cab331c7eba8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 18 Dec 2011 21:14:33 +0100 Subject: [PATCH] ftw: Add `scandir'. Suggested by Nala Ginrut . * module/ice-9/ftw.scm (scandir): New procedure. * test-suite/tests/ftw.test ("scandir"): New test prefix. * doc/ref/misc-modules.texi (File Tree Walk): Document `scandir'. --- doc/ref/misc-modules.texi | 12 ++++++++++++ module/ice-9/ftw.scm | 32 +++++++++++++++++++++++++++++++- test-suite/tests/ftw.test | 8 ++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/doc/ref/misc-modules.texi b/doc/ref/misc-modules.texi index 617762441..cf0c59975 100644 --- a/doc/ref/misc-modules.texi +++ b/doc/ref/misc-modules.texi @@ -1249,6 +1249,18 @@ to `du --apparent-size' with GNU Coreutils.)" The alternative C-like functions are described below. +@defun scandir name [select? [entry (file-system-fold enter? leaf down up skip '() name stat) + (lambda (files) + (sort files entry))) + (match (scandir (string-append %test-dir "/tests") select?) + (("." ".." "00-initial-env.test" (? select?) ...) + #t)))))