From 0d44fe55fd975fce4b388ab96923cc5df7e3b309 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 19 Nov 1999 14:12:53 +0000 Subject: [PATCH] New procedure DIRECTORY-FILE-NAMES for those cases when DIRECTORY-READ is a pain. --- v7/src/runtime/sfile.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/v7/src/runtime/sfile.scm b/v7/src/runtime/sfile.scm index 358f3c1a0..2d60e401f 100644 --- a/v7/src/runtime/sfile.scm +++ b/v7/src/runtime/sfile.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: sfile.scm,v 14.21 1999/11/19 14:10:49 cph Exp $ +$Id: sfile.scm,v 14.22 1999/11/19 14:12:53 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -53,16 +53,19 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (current-file-time) (call-with-temporary-file-pathname file-modification-time)) -(define (directory-file-names directory) +(define (directory-file-names directory #!optional include-dots?) (let ((channel (directory-channel-open - (->namestring (pathname-as-directory directory))))) + (->namestring (pathname-as-directory directory)))) + (include-dots? + (if (default-object? include-dots?) #f include-dots?))) (let loop ((result '())) (let ((name (directory-channel-read channel))) (if name (loop - (if (or (string=? "." name) - (string=? ".." name)) + (if (and (not include-dots?) + (or (string=? "." name) + (string=? ".." name))) result (cons name result))) (begin -- 2.25.1