From: Peter S. <pe...@ja...> - 2004-02-05 00:40:30
|
So I've been testing out various pathname foo in different implementations. I ran into this seeming odditiy in CLISP (tested in 2.31 and 2.32 on GNU/Linux). I have this directory: [peter@xeon src]$ ls -l /tmp/foo total 28 drwxrwxr-x 2 peter peter 4096 Jan 28 10:29 empty-subdir drwxrwxr-x 2 peter peter 4096 Jan 28 10:29 empty-subdir-with.type -rw-rw-r-- 1 peter peter 27 Feb 4 14:14 file-with-no-type -rw-rw-r-- 1 peter peter 28 Feb 4 14:14 file-with.two.dots -rw-rw-r-- 1 peter peter 28 Feb 4 14:14 file-with-type.txt drwxrwxr-x 3 peter peter 4096 Jan 30 11:24 non-empty-subdir drwxrwxr-x 2 peter peter 4096 Jan 28 10:29 non-empty-subdir-with.type [peter@xeon src]$ Notice that the results of the following two calls to DIRECTORY return differ in one file: when both :name and :type are :wild the file "file-with-no-type" is not returned. But when :type is NIL it is. It seems that these two expressions ought to behave exactly the same. Am I missing something? [3]> (defun x (p) `(:directory ,(pathname-directory p) :name ,(pathname-name p) :type ,(pathname-type p))) X [4]> (format t "~{~s~%~}" (mapcar #'x (directory (make-pathname :directory '(:absolute "tmp" "foo") :name :wild :type :wild)))) (:DIRECTORY (:ABSOLUTE "tmp" "foo") :NAME ".dotted-with-two" :TYPE "dots") (:DIRECTORY (:ABSOLUTE "tmp" "foo") :NAME "file-with.two" :TYPE "dots") (:DIRECTORY (:ABSOLUTE "tmp" "foo") :NAME ".dotted" :TYPE NIL) (:DIRECTORY (:ABSOLUTE "tmp" "foo") :NAME "file-with-type" :TYPE "txt") NIL [5]> (format t "~{~s~%~}" (mapcar #'x (directory (make-pathname :directory '(:absolute "tmp" "foo") :name :wild :type nil)))) (:DIRECTORY (:ABSOLUTE "tmp" "foo") :NAME ".dotted-with-two" :TYPE "dots") (:DIRECTORY (:ABSOLUTE "tmp" "foo") :NAME "file-with.two" :TYPE "dots") (:DIRECTORY (:ABSOLUTE "tmp" "foo") :NAME ".dotted" :TYPE NIL) (:DIRECTORY (:ABSOLUTE "tmp" "foo") :NAME "file-with-no-type" :TYPE NIL) (:DIRECTORY (:ABSOLUTE "tmp" "foo") :NAME "file-with-type" :TYPE "txt") NIL -Peter -- Peter Seibel pe...@ja... Lisp is the red pill. -- John Fraser, comp.lang.lisp |