From f03310d76a2458e5efb45b89f8e6b087db7f4ed1 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Fri, 1 Oct 2004 03:10:16 +0000 Subject: [PATCH] r10067: add keyword --- impl.lisp | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/impl.lisp b/impl.lisp index c17449c..a814cc4 100644 --- a/impl.lisp +++ b/impl.lisp @@ -37,22 +37,29 @@ path)))) -(defun probe-directory (filename) - (let ((path (canonicalize-directory-name filename))) - #+allegro (excl:probe-directory path) - #+clisp (values - (ignore-errors - (#+lisp=cl ext:probe-directory #-lisp=cl lisp:probe-directory - path))) - #+(or cmu scl) (when (eq :directory (unix:unix-file-kind (namestring path))) - path) - #+lispworks (when (lw:file-directory-p path) - path) - #+sbcl (when (eq :directory (sb-unix:unix-file-kind (namestring path))) - path) - #-(or allegro clisp cmu lispworks sbcl scl) - (probe-file path))) - +(defun probe-directory (filename &key (error-if-not-exists nil)) + (let* ((path (canonicalize-directory-name filename)) + (probe + #+allegro (excl:probe-directory path) + #+clisp (values + (ignore-errors + (#+lisp=cl ext:probe-directory + #-lisp=cl lisp:probe-directory + path))) + #+(or cmu scl) (when (eq :directory + (unix:unix-file-kind (namestring path))) + path) + #+lispworks (when (lw:file-directory-p path) + path) + #+sbcl (when (eq :directory + (sb-unix:unix-file-kind (namestring path))) + path) + #-(or allegro clisp cmu lispworks sbcl scl) + (probe-file path))) + (if probe + probe + (when error-if-not-exists + (error "Directory ~A does not exist." filename))))) (defun cwd (&optional dir) "Change directory and set default pathname" -- 2.34.1