Julian Scheid <[email protected]> writes:
> Unfortunately, neither readlink --canonicalize nor the perl script
> work reliably:
>
> (file-truename "/does/not/exist")
> "/does/not/exist"
>
> $ perl -e 'use Cwd "realpath"; print realpath("/does/not/exist");'
> $ # empty
>
> $ readlink --canonicalize /does/not/exist
> $ # empty
What about this:
$ perl -e 'use Cwd "realpath"; (-e "/does/not/exist") ? print
realpath("/does/not/exist") : print "/does/not/exist"; print "\n"'
/does/not/exist
$ readlink --canonicalize-missing /does/not/exist
/does/not/exist
$ ll /tmp/xxx
lrwxrwxrwx 1 albinus smc3 13 08-14 09:20 /tmp/xxx -> /home/albinus/
perl -e 'use Cwd "realpath"; (-e "/tmp/xxx") ? print realpath("/tmp/xxx") :
print "/tmp/xxx"; print "\n"'
/home/albinus
$ readlink --canonicalize-missing /tmp/xxx
/home/albinus
Best regards, Michael.
_______________________________________________
Tramp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/tramp-devel