Julian Scheid <[email protected]> writes:
> Patch take two attached.
Looks OK to me. I've committed it.
> Related question:
>
> file-truename appears to always return a value ending in a slash when
> its argument ends in a slash, and vice versa.
>
> The cache used in tramp-handle-file-truename, however, seems to not
> distinguish between the two and so if truename for foo/ is requested
> and later truename for foo, the result for the latter will end in a
> slash. Did this come up before? Do you think this could be a problem
> and if so, any thoughts on how to best fix it?
The file cache enters file names via (directory-file-name file).
Therefore, both file names are equivalent. This is due to performance
reasons, because most cached values are equal in both cases.
I don't know whether it matters, how Tramp returns the file
name. Usually, applications shall care about, and call either
directory-file-name or file-name-as-directory, depending what they need.
Maybe one could embed the code of tramp-handle-file-truename like this
(untested):
(funcall
(if (match-string "/$" filename)
'file-name-as-directory
'directory-file-name)
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-file-property v localname "file-truename"
...
But I'm not sure, whether file-name-as-directory does something
unexpected, when the local machine runs W32 or VMS or whatever.
Best regards, Michael.
_______________________________________________
Tramp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/tramp-devel