1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

10 commits

Author SHA1 Message Date
Ludovic Courtès
be96155b50 ftw: Add an error' parameter to file-system-fold'.
* module/ice-9/ftw.scm (errno-if-exception): New macro.
  (file-system-fold): Add an `error' parameter.  Wrap `opendir' and STAT
  calls in `errno-if-exception' and call ERROR when appropriate.
  (file-system-tree): Provide an `error' procedure.  Return #f when
  FILE-NAME is unreadable.
  (scandir): Provide an `error' procedure.

* test-suite/tests/ftw.test (%top-builddir): New variable.
  (make-file-tree, delete-file-tree): New procedures.
  (with-file-tree): New macro.
  ("file-system-fold"): Update tests to add an `error' procedure.
  ["ENOENT", "EACCES", "dangling symlink and lstat", "dangling symlink
  and stat"]: New tests.
  ("file-system-tree")["ENOENT"]: New test.
  ("scandir")["EACCES"]: New test.

* doc/ref/misc-modules.texi (File Tree Walk): Update `file-system-fold'
  documentation.
2012-01-08 16:16:21 +01:00
Ludovic Courtès
a2c66014cf ftw: Include sub-directories in the result of `scandir'.
* module/ice-9/ftw.scm (scandir)[skip]: Keep NAME in the resulting list.

* test-suite/tests/ftw.test ("scandir")["top-srcdir"]: New test.
2011-12-19 22:25:30 +01:00
Ludovic Courtès
fa8110f241 ftw: Fix typos/thinkos in file-system-fold' and scandir'.
* module/ice-9/ftw.scm (file-system-fold): Fix reference to STAT instead
  of ST.
  (scandir)[enter?]: Change the argument name to `dir', to avoid
  confusion.
  [skip]: Return RESULT, not #f.
2011-12-19 09:18:42 +01:00
Ludovic Courtès
de92987002 ftw: Clarify the behavior of `scandir' for flat files and unreadable dirs.
* module/ice-9/ftw.scm (scandir)[leaf]: Only add NAME when RESULT is a
  pair.
  [down]: Ignore RESULT.
  Start with #f instead of the empty list.

* test-suite/tests/ftw.test ("scandir")["flat file"]: New test.

* doc/ref/misc-modules.texi (File Tree Walk): Update `scandir'
  documentation accordingly.
2011-12-19 09:11:51 +01:00
Ludovic Courtès
1629429d63 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'.
2011-12-18 21:18:38 +01:00
Ludovic Courtès
af98fafabf ftw: Add an optional stat' parameter to file-system-fold' and `-tree'.
* module/ice-9/ftw.scm (file-system-fold): Add an optional `stat'
  parameter.  Use it instead of `lstat'.  Handle the case where (STAT child)
  fails.
  (file-system-tree): Likewise, and pass it to `file-system-fold'.

* doc/ref/misc-modules.texi (File Tree Walk): Update the documentation
  of these functions.
2011-12-18 20:43:56 +01:00
Ludovic Courtès
243db01e51 Add file-system-fold' and file-system-tree' to (ice-9 ftw).
* module/ice-9/ftw.scm (file-system-fold, file-system-tree): New
  procedures.

* test-suite/tests/ftw.test (%top-srcdir, %test-dir): New variables.
  ("file-system-fold", "file-system-tree"): New test prefixes.

* doc/ref/misc-modules.texi (File Tree Walk): Document
  `file-system-tree' and `file-system-fold'.
2011-12-13 23:56:19 +01:00
Ludovic Courtès
c4e843571f "filesystem" -> "file system"
* doc/ref/misc-modules.texi, doc/sources/unix.texi,
  module/ice-9/ftw.scm: Replace "filesystem" by "file system".
2009-11-24 23:16:08 +01:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Andy Wingo
00d0489205 move ice-9/ and oop/ under module/
Moved ice-9/ and oop/ under module/, with the idea being that we have
only scheme under module/. Adjusted configure.in and Makefile.am
appropriately. Put oop/ at the end of the compilation order.
2008-11-01 12:44:21 +01:00
Renamed from ice-9/ftw.scm (Browse further)