proper use of "directory"



i need to have a list of the files in a directory, and am trying to do
it like this :

(defun load-all-files (in-dir)
(directory (make-pathname :name :wild :type :wild :defaults in-
dir)))

it works fine for directories with a few files.

for the problem i'm working on, this directory contains thousands of
files (> 20,000). in this scenario, it seems to take for ever.

is there a better way to use directory ? some way for it to stream the
contents of the directory, rather than cons'ing up a list ?

thanks,
.


Quantcast