Dear Lispers,
I can't believe it!
In the context of a World-Wide Web indexing module I am working on, I came
across the tiny problem of having to traverse the directory tree with all
the .html files.
In Macintosh Common Lisp there is a built-in predicate directoryp which
allows to tell the difference between a file and a directory, so it is easy
to recursively descend into a subdirectory.
What would be the equivalent in (Franz) Common Lisp on a Unix box? There
must be an easy way of setting up a function that returns all pathnames in
a directory tree. I can' be the first one with that problem!!!
Steele CLtL2 doesn't offer any useful keywords for the directory function.
Any comments are appreciated. I'll summarize.
Hans-Martin Adorf
ST-ECF/ESO
Karl-Schwarzschild-Str. 2
D-85748 Garching b. Muenchen
Germany
Tel: +49-89-32006-261
Fax: +49-89-32006-480
Internet: ·····@eso.org
In article <··················@st53.hq.eso.org> ·····@eso.org (Hans-Martin Adorf) writes:
>In Macintosh Common Lisp there is a built-in predicate directoryp which
>allows to tell the difference between a file and a directory, so it is easy
>to recursively descend into a subdirectory.
>
>What would be the equivalent in (Franz) Common Lisp on a Unix box? There
>must be an easy way of setting up a function that returns all pathnames in
>a directory tree. I can' be the first one with that problem!!!
There's probably a DIRECTORYP predicate in Allegro CL as well, but maybe
it's internal and not documented. There's no portable way to do this (is
there any language that provides a portable interface to directories?).
(probe-file "pathname/.")
will tell if "pathname" names a directory on Unix.
--
Barry Margolin
System Manager, Thinking Machines Corp.
······@think.com {uunet,harvard}!think!barmar