2

I'm using CCL on OS X Yosemite.

When I use e.g.

(directory "*")

in directory

/Users/Tom

for listing all directory entries, but /Users/Tom contains a broken symbolic link (e.g. slime where the directory linked to does not exist any more),

File #P"/Users/Tom/slime" does not exist.
   [Condition of type CCL::SIMPLE-FILE-ERROR]

is thrown.

Is there a way to get get a list of directory entries in such a directory with a broken symbolic link?

1 Answers1

3

One option is to use the non-standard CCL extension :follow-links nil. Most implementations have something similar as an extra option to directory.

Xach
  • 11,774
  • 37
  • 38
  • You are right. I tried this also and it works - with some very strange behavior in the REPL if executed from there. But I thought that a CL standard way to do that should exist. The behaviour of `directory` is not specified in detail in the CLHS - but IMHO following links is not what `directory` should do by default. – carpetemporem May 08 '15 at 15:26
  • 1
    `directory` is specified to return pathnames corresponding to the truenames of the files. Most implementations interpret truename as being the target of the symbolic link. The typical behavior of directory is consistent with that interpretation. – Xach May 08 '15 at 15:45
  • You are right with the truenames according to the CLHS. Still I think, that `directory` doesn't do the right thing because it's just unusable in the current form and that feels wrong to me. And there doesn't seem to be a way to access the real directory entries. – carpetemporem May 09 '15 at 07:22