[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarch

From: Thierry Volpiatto
Subject: bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy
Date: Mon, 27 Feb 2012 20:33:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)

Michael Albinus <michael.albinus@gmx.de> writes:

> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>> If you don't create "test1" and file-subdir-of-p is unable to handle a
>> non--existing directory,I don't understand how you want to do.
> I was saying that files-equal-p returns unexpected results in case both
> files do not exist. 
In this case this version return nil even if noexist is not provided.

(defun files-equal-p (file1 file2 &optional noexist)
  "Return non-nil if FILE1 and FILE2 name the same file.
This function works even on non--existing files."
  (let ((handler (or (find-file-name-handler file1 'files-equal-p)
                     (find-file-name-handler file2 'files-equal-p))))
    (if handler
        (funcall handler 'files-equal-p file1 file2 noexist)
      (let ((f1-attr (file-attributes (file-truename file1)))
            (f2-attr (file-attributes (file-truename file2))))
        (if (and f1-attr f2-attr)
            (equal f1-attr f2-attr)
          (when noexist
            (string= (file-truename
                      (file-name-as-directory file1))
                      (file-name-as-directory file2)))))))))

> I haven't spoken about file-subdir-of-p.
> Best regards, Michael.

Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]