(directory "foo/**/" returns all files
From the cmucl tree, consider this:
* (directory "src/**/")
(#P"<path>/src/assembly/"
#P"<path>/src/assembly/alpha/"
#P"<path>/src/assembly/alpha/alloc.lisp"
#P"<path>/src/assembly/alpha/arith.lisp"
#P"<path>/src/assembly/alpha/array.lisp"
#P"<path>/src/assembly/alpha/assem-rtns.lisp"
#P"<path>/src/assembly/alpha/support.lisp"
#P"<path>/src/assembly/amd64/"
#P"<path>/src/assembly/amd64/alloc.lisp"
...)
All the files are listed, including the lisp files. I was kind of expecting just the directories to be listed. This is how clisp, ecl, and sbcl work. To get all the files, they use "src/**/.".
On the other hand, consider
* (pathname-match-p #P"src/assembly/assemfile.lisp" "src/**/")
#P"src/assembly/assemfile.lisp"
* (pathname-match-p #P"src/assembly/assemfile.lisp" "src/**/*.*")
#P"src/assembly/assemfile.lisp"
So cmucl directory
behavior is consistent with pathname-match-p
,
as mentioned in CLHS
pathname-match-p
.
However, ecl says
> (pathname-match-p #P"src/assembly/alpha/alloc.lisp" #p"src/**/")
NIL
Perhaps cmucl is right here and ecl is wrong. The spec does say:
Missing components of wildcard default to :wild.
which I interpret to mean the wildcard #p"src/**/"
should be
interpreted as #p"src/**/*.*"
.
Edited by Raymond Toy