[Openmcl-devel] Directory and symlinks
Zach Beane
xach at xach.com
Wed Nov 9 09:03:17 PST 2011
Gary Byers <gb at clozure.com> writes:
> On Wed, 9 Nov 2011, Zach Beane wrote:
>
>>> What's different about what I'm doing and what you're doing ?
>>
>> The symlink in my case is behind the wildcard, perhaps that makes the
>> difference?
>>
>
> Yes, it seems to.
>
>> Does (directory "*/*.image") return the /usr/local/src/ccl/*.image files
>> for you?
>>
>
> No, and there's at least some argument that it shouldn't. (I'm not absoulutely
> sure that I believe that argument ...)
>
> The argument is that DIRECTORY is supposed to find matching files that are
> present in the filesystem and return their truenames. Does "foo" (or "ccl")
> match the first wildcard in the argument to (directory "*/*.image") ? The
> truenames of those links clearly do, but it's less clear that the links themselves
> do. (I can imagine wanting both behaviors.)
>
> A fairly recent CLISP returns a list containing the .image files in
> the link's target in your example; a fairly recent SBCL and current CCL don't.
>
>
> (directory "ccl") ; same environment as above
>
> returns a list of that file's truename in SBCL, NIL in CCL, and errors in CLISP.
> (I think that SBCL's result is more consistent here than CCL's is.)
>
> This is probably only one of several ways in which DIRECTORY behaves differently
> across implementations.
I posed the same question to the SBCL list, and the failure to return
what I expected was considered a bug and fixed as of today. With that
change, Allegro CL, CLISP, CMUCL, ECL, LispWorks, and SBCL agree about
the return value of (directory "foo/*/*.txt").
I don't think majority agreement makes it right, but it certainly would
be convenient, from my perspective, if the agreement was unanimous.
Zach
More information about the Openmcl-devel
mailing list