Subject: Re: bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy

From: Michael Albinus <[email-masked]>
Date: Mon, 16 Jan 2012 15:13:11 +0100

Stefan Monnier <[email-masked]> writes:

>>> (string= (directory-file-name (file-truename (expand-file-name file1)))
>>> (directory-file-name (file-truename (expand-file-name file2))))))
>
>> So, any objections to apply my patch to trunk with these changes?
>
> Couldn't we use something closer to what we want to ideally use?
> E.g. (equal (file-attributes file1) (file-attributes file2))?

We need at least the `file-truename' call. 

(equal (file-attributes (file-truename (expand-file-name file1)))
       (file-attributes (file-truename (expand-file-name file2))))))

I don't know, whether `file-truename' calls `expand-file-name'
internally. `tramp-sh-handle-file-truename' does. Maybe we don't need it.

We could also add already the check for the file name handler. When
there is no file name handler (Emacs 24.1), it doesn't hurt. Later on,
we don't need to touch the fucntion, again. And I'll start to add the
file name handler upstream Tramp, once the function is available in
Emacs 24.1.

>         Stefan

Best regards, Michael.