found 257568 5.10.1-13
thanks
In this case, the correct return value would surely be '/tmp/link'.
In this situation '/tmp/dir' would be plain wrong. Since link doesn't
exists, it's by definition absolute if we are just about to create it.
where we use it to get an absolute path to a directory which isn't
yet created. I'm sure it's been fixed and re-introduced sometime
in the past year because it was working fine last year and I was
just notified that it had regressed.
To justify why I think this is a serious misfeature, let's look at
what we want to do. abs_path is doing two things:
1) if the path is relative to the CWD, we make it absolute
2) if the path contains any symbolic links, we remove them
Now, if the path doesn't yet exist, by definition it doesn't
contain any links, so part 2 can be skipped. But making it
absolute is still useful. The path may also partially exist.
If I'm in /tmp/foo and call abs_path('bar') then it could
return /tmp/foo/bar if /tmp/foo contains no links. If foo
was a symlink to /srv/baz then it should return /srv/baz/bar.
To summarise: abs_path can still work sanely in the existence
of a nonexistent (or partially existent) path. It can walk up
the tree so far as it can (while it exists) both making it
absolute and removing links as necessary and then it can
return the nonexistent part verbatim after that. For users
who want to get a canonicalised path, returning undef when
there's a perfectly reasonable answer to give them is not
good, and it would be great to get this long-standing
regression fixed.
Regards,
Roger