Others have written about what Common Lisp's logical pathnames (sic) are good for, and what not: the short version is that they are not intended for accessing or even describing files not under the control of the Lisp program.
However, we still have to implement the damn things. So here's an entertaining question: what does
mean, given that (logical-pathname-translations "FOO")
? Naïve implementations of directory
will throw an error, because they will attempt to translate (in the
sense) a logical pathname for which no translation exists. I would advocate a different interpretation: that all possible pathnames matching the queried one should be translated, and the resulting physical queries carried out.
In practice, this requires computing the intersection of two wild pathnames (in the example above, "FOO:DEFSYSTEM.*" and "FOO:**;*.LISP", for instance, which clearly have an intersection of "FOO:DEFSYSTEM.LISP"). This turns out, somewhat surprisingly, to be an immensely difficult operation to express — it took me over 100 lines of Lisp, and I'm still not confident that it's doing the right thing even for a relatively limited, though common, subset of pathnames.
But what sweet joy it is to be able to do (directory "SYS:*;") and have SBCL return (#P"/home/csr21/sourceforge-cvs/sbcl/contrib/" #P"/home/csr21/sourceforge-cvs/sbcl/src/").