On Mon, Aug 06, 2001 at 04:19:59PM -0500, William Harold Newman wrote:
> On Mon, Aug 06, 2001 at 07:33:00PM +0100, Christophe Rhodes wrote:
> > On Mon, Aug 06, 2001 at 12:56:15PM -0500, William Harold Newman wrote:
> > > [ snip many great improvements ]
> > > * minor incompatible change: The old CMU-CL-style DIRECTORY options,
> > > i.e. :ALL, :FOLLOW-LINKS, and :CHECK-FOR-SUBDIRS, are no longer
> > > supported. Now DIRECTORY always does the abstract Common-Lisp-y
> > > thing, i.e. :ALL T :FOLLOW-LINKS T :CHECK-FOR-SUBDIRS T.
> > The problem, insofar as this is a problem, with this change is that
> > there is now no way, at least on linux, to express the concept "give
> > me all the lisp files on my system". This is because the natural
> > expression, (directory "/**/*.lisp"), will loop infinitely because of
> > the /proc/ filesystem.
> > This might want to be documented somewhere, or thought about some
> > more.
> I'm only vaguely familiar with the /proc/ filesystem, but I assume
> from your description that there's some problem of a directory, or
> link, referring to itself? (directly or indirectly)
Yes. The proc/ filesystem contains references to open file
descriptors, for instance, and processes' current working directories;
if any process has a reference to /, then directory will loop.
> If so, it might work to have DIRECTORY handle it the same way that it
> currently handles other circularities (like symbolic links referring
> to themselves) by breaking the cycle (at some arbitrary point) and
> returning the thing doing the reference, rather than doggedly chasing
> down what it refers to until the sun burns out.
> Would it be possible to implement such a solution for this problem?
> (preferably without too much pain..) What kinds of cycles are causing
> the problem, exactly? Is it just the softlinks back to the root fs?
> * (truename "/proc/704/root")
These are the main problem, I suppose. Certainly they're the most
> I haven't looked at it in any detail -- especially since I'm neither
> quite clear on what the problem is, nor adventurous/patient enough to
> run (directory "/**/*.lisp") on my system and try to figure it out
> from the output -- but it might not be hard to fix this by making the
> handling of "/**/" detect cycles.
This would be nice, though it's not obvious how to make it nice. The
last time I looked at %enumerate-matches (getting on for three years
ago...) it wasn't pretty; I daresay that hasn't improved...
I suppose what directory could do is maintain a list of directories
that it has visited, and refuse to revisit them; I think that this
would be consistent with the philosophy of doing the `Lispy' thing...
Jesus College, Cambridge, CB5 8BL +44 1223 510 299
http://www-jcsu.jesus.cam.ac.uk/~csr21/ (defun pling-dollar
(str schar arg) (first (last +))) (make-dispatch-macro-character #\! t)
(set-dispatch-macro-character #\! #\$ #'pling-dollar)