taruss
6/3/2016 9:27:00 PM
On Friday, June 3, 2016 at 8:24:22 AM UTC-7, Jim Newton wrote:
First of all, much of the pathname-related stuff is highly implementation and
(or course) platform dependent. However, in this case it seems that your
lisp is doing exactly what it is supposed to do.
> When I call (DIRECTORY #p"/tmp/")
> it returns
> (#p"/private/tmp"), I assume this is because DIRECTORY has problems with symbolic links, and
> on my system /tmp is a symbolic link to /private/tmp
>
> However, (DIRECTORY #'"/private/tmp/")
> also returns (#p"/private/tmp")
> as does (DIRECTORY #'"/private/tmp/.") and (DIRECTORY #'"/private/tmp")
>
That isn't necessarily surprising, given some for of canonicalization of the pathname. So I could see that those would all return the same thing.
The Hyperspec says:
"Description:
Determines which, if any, files that are present in the file system have
names matching pathspec, and returns a fresh list of pathnames corresponding
to the truenames of those files."
and adds the note:
"If the pathspec is not wild, the resulting list will contain either zero or
one elements."
So it is telling you that all of those exact pathspecs have the same canonical
name in the filesystem. To get more matches, you would need to include
wildcard characters:
(directory "/tmp/*")
you would get the list that you perhaps expect to get.