From: Kevin M. Rosenberg Date: Fri, 1 Oct 2004 03:10:16 +0000 (+0000) Subject: r10067: add keyword X-Git-Tag: v1.96~53 X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=commitdiff_plain;h=f03310d76a2458e5efb45b89f8e6b087db7f4ed1;hp=d4bfdf559cbd44dee337d2d2fbb457bfe1cec56e r10067: add keyword --- 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"