commit 2ba0107fa53419584543dafdccd046ff8e3c9da5 Author: Piotr Kalinowski Date: Sat Jul 27 15:07:54 2013 +0200 Fix subdirectories for clozure When using :follow-links nil, Clozure CL treats all symbolic links as file names, even if they point to directories, which means that UIOP:SUBDIRECTORIES did not return them, and when collecting subdirectories, they would not be traversed. So to properly collect subdirectories on CCL without following links, it is necessary to list all the directory contents, and filter them by DIRECTORY-EXISTS-P. diff --git a/uiop/filesystem.lisp b/uiop/filesystem.lisp index 6a3c314..8b03c43 100644 --- a/uiop/filesystem.lisp +++ b/uiop/filesystem.lisp @@ -195,26 +195,30 @@ or the original (parsed) pathname if it is false (the default)." (let* ((directory (ensure-directory-pathname directory)) #-(or abcl cormanlisp genera xcl) (wild (merge-pathnames* - #-(or abcl allegro cmu lispworks sbcl scl xcl) + #-(or abcl allegro clozure cmu lispworks sbcl scl xcl) *wild-directory* + #+clozure + *wild-file* #+(or abcl allegro cmu lispworks sbcl scl xcl) "*.*" directory)) (dirs #-(or abcl cormanlisp genera xcl) (ignore-errors - (directory* wild . #.(or #+clozure '(:directories t :files nil) + (directory* wild . #.(or #+clozure '(:directories t :files t) #+mcl '(:directories t)))) #+(or abcl xcl) (system:list-directory directory) #+cormanlisp (cl::directory-subdirs directory) #+genera (fs:directory-list directory)) - #+(or abcl allegro cmu genera lispworks sbcl scl xcl) + #+(or abcl allegro clozure cmu genera lispworks sbcl scl xcl) (dirs (loop :for x :in dirs :for d = #+(or abcl xcl) (extensions:probe-directory x) #+allegro (excl:probe-directory x) + #+clozure (directory-exists-p x) #+(or cmu sbcl scl) (directory-pathname-p x) #+genera (getf (cdr x) :directory) #+lispworks (lw:file-directory-p x) :when d :collect #+(or abcl allegro xcl) d + #+clozure (ensure-directory-pathname x) #+genera (ensure-directory-pathname (first x)) #+(or cmu lispworks sbcl scl) x))) (filter-logical-directory-results