[Openmcl-devel] (directory ...) errors under special conditions

Gary Byers gb at clozure.com
Thu Sep 16 16:32:17 PDT 2010


I don't know if complaining about a stale link was correct or not,
but it was certainly annoying.  It should have been fixed several
months ago (before 1.5 was released), and certainly seems to have been:

[src/ccl-1.5] gb at abq> ls -l /tmp/dirtest/
total 0
lrwxr-xr-x  1 gb  wheel  18 Sep 16 16:38 hellolink -> /tmp/dirtest/hello
[src/ccl-1.5] gb at abq> ./fx86cl
Welcome to Clozure Common Lisp Version 1.5-r13651  (FreebsdX8632)!
? (directory #p"/tmp/dirtest/**/*" :directories t :follow-links t)
(#P"/tmp/dirtest/hellolink")
?

I think that you could make the argument that it'd be better not to
return the broken link unless :follow-links NIL is in effect, if only
to make it easier for DIRECTORY's caller to process the result without
worrying about this case.  I dunno; the counterargument seems to be
about as convincing.


On Thu, 16 Sep 2010, R.Stoye wrote:

> Hi,
>
> i am not sure if this is expected behavior:
>
> directory errors on soft-links when
> - the target is missing,
> - using :directories t and :follow-links t
> - the path contains :wild-inferiors
>
> ccl::%all-directories calls truename which throws an error if the file 
> doesn't exist
>
>
> ;; to reproduce create a file, a link to it, and delete the file
> mkdir /tmp/dirtest
> touch /tmp/dirtest/hello
> ln -s /tmp/dirtest/hello /tmp/dirtest/hellolink
> rm /tmp/dirtest/hello
>
> ;; then the following fails
> (directory #p"/tmp/dirtest/**/*" :directories t :follow-links t)
> fails. (Error: File #P"/tmp/dirtest/hellolink" does not exist)
>
> ;; the following works
> (directory #p"/tmp/dirtest/*" :directories t :follow-links t)
> returns (#P"/tmp/dirtest/hellolink")
>
> regards,
> Ralf Stoye
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>



More information about the Openmcl-devel mailing list