Question about resolving "symlink/.."

Jared C. Davis jared.c.davis at
Thu Sep 8 11:07:03 UTC 2016


I have set up the following directory hierarchy:

     |                      |
      subdir1                subdir3 ---symlink---+
     |                                        |
       +-+---------+                              |
       |           |                              |
      xxxdir      subdir2  <----------------------+
       |               |
      xxx.txt        yyydir

On my linux system, shell commands like "ls" seem to resolve
paths such as "lstest-dir/subdir3/.." to "lstest-dir/subdir1".
For instance:

    $ ls lstest-dir/subdir3/../xxxdir

In other words, when a path goes through "<symlink>/..", it seems
to be resolved by first following the symlink, then finding the
parent directory of the symlink's target.

However, it appears that uiop:ensure-directory-pathname resolves
".." in a different way.  For instance, on CCL on Linux, when I

      (uiop:parse-native-namestring "lstest-dir/subdir3/.."))

I get #P"lstest-dir/" instead of #P"lstest-dir/subdir1".

Is there a way to configure ensure-directory-pathname to use a
more shell-like behavior, or some other alternative that I might
run to preprocess the path to resolve these obscure cases like
the shell does?


Jared C. Davis <jared.c.davis at>
11410 Windermere Meadows
Austin, TX 78759

More information about the asdf-devel mailing list