summaryrefslogtreecommitdiff
path: root/doc/ref/misc-modules.texi
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2011-12-18 21:14:33 +0100
committerLudovic Courtès <ludo@gnu.org>2011-12-18 21:18:38 +0100
commit1629429d63170b1c5a19e72e838cab331c7eba8b (patch)
tree1e35edf9fe448c019538f14f926666177377b403 /doc/ref/misc-modules.texi
parentaf98fafabfa1a6d22688ff491fea63155665f2e5 (diff)
downloadguile-1629429d63170b1c5a19e72e838cab331c7eba8b.tar.gz
ftw: Add `scandir'.
Suggested by Nala Ginrut <nalaginrut@gmail.com>. * 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'.
Diffstat (limited to 'doc/ref/misc-modules.texi')
-rw-r--r--doc/ref/misc-modules.texi12
1 files changed, 12 insertions, 0 deletions
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<?]]
+Return the list of the names of files contained in directory @var{name}
+that match predicate @var{select?} (by default, all files). The
+returned list of file names is sorted according to @var{entry<?}, which
+defaults to @code{string-locale<?} such that file names are sorted in
+the locale's alphabetical order (@pxref{Text Collation}).
+
+This procedure is modeled after the C library function of the same name
+(@pxref{Scanning Directory Content,,, libc, GNU C Library Reference
+Manual}).
+@end defun
+
@defun ftw startname proc ['hash-size n]
Walk the file system tree descending from @var{startname}, calling
@var{proc} for each file and directory.