From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy Date: Fri, 24 Feb 2012 13:54:16 +0100 Message-ID: <87haygie87.fsf@gmx.de> References: <87mx9su32g.fsf@web.de> <8762gckckt.fsf@gmail.com> <87pqek9269.fsf@gmx.de> <87r4z0yqfx.fsf@gmail.com> <871uqzn3bc.fsf@gmx.de> <871uqz651u.fsf@gmx.de> <87pqd89lh4.fsf@gmail.com> <87mx8b3nvb.fsf@gmail.com> <87pqd6wnvv.fsf@gmail.com> <87d395y1w0.fsf@gmail.com> <87zkc8x04p.fsf@gmail.com> <87vcmwwvk7.fsf@gmail.com> <834nugtwqf.fsf@gnu.org> <87r4xkwhky.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1330088162 12237 80.91.229.3 (24 Feb 2012 12:56:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 24 Feb 2012 12:56:02 +0000 (UTC) Cc: 10489@debbugs.gnu.org To: Thierry Volpiatto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 24 13:56:01 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from [140.186.70.17] (helo=lists.gnu.org) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S0ugr-0007KZ-6n for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Feb 2012 13:56:01 +0100 Original-Received: from localhost ([::1]:43117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0ugY-0000JW-TW for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Feb 2012 07:55:42 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:60153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0ugS-0000H0-Kp for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2012 07:55:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0ugM-00044H-Be for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2012 07:55:36 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0ugM-000442-9t for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2012 07:55:30 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S0uio-0005sv-L9 for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2012 07:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Feb 2012 12:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10489 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 10489-submit@debbugs.gnu.org id=B10489.133008823022551 (code B ref 10489); Fri, 24 Feb 2012 12:58:02 +0000 Original-Received: (at 10489) by debbugs.gnu.org; 24 Feb 2012 12:57:10 +0000 Original-Received: from localhost ([127.0.0.1]:53517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0uhx-0005rf-EY for submit@debbugs.gnu.org; Fri, 24 Feb 2012 07:57:10 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:46466) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1S0uht-0005r4-VS for 10489@debbugs.gnu.org; Fri, 24 Feb 2012 07:57:07 -0500 Original-Received: (qmail invoked by alias); 24 Feb 2012 12:54:24 -0000 Original-Received: from p57BB94C0.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.148.192] by mail.gmx.net (mp012) with SMTP; 24 Feb 2012 13:54:24 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX19VQ8UAX6pV46FX6wrvdPmTFsxNrasSqVNLe85ypH x+roOQvlhlN1/k In-Reply-To: <87r4xkwhky.fsf@gmail.com> (Thierry Volpiatto's message of "Fri, 24 Feb 2012 13:18:05 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:57165 Archived-At: Thierry Volpiatto writes: > --- a/lisp/files.el > +++ b/lisp/files.el > +(defun files-equal-p (file1 file2) > + > +(defun file-subdir-of-p (dir1 dir2) For both functions, please check for a file name handler, and call it if available. It doesn't matter that they are not implemented yet; there is the fallback to the native implementation in that case. With this check, I could start to implement the file name handlers in Tramp's upstream repository. > +(defun files-equal-p (file1 file2) > + "Return non-nil if FILE1 and FILE2 name the same file." > + (and (equal (file-remote-p file1) (file-remote-p file2)) > + (equal (file-attributes (file-truename file1)) > + (file-attributes (file-truename file2))))) This implementation requires, that inode number and filesystem device number are always unique. This is true for local files, if you run a Unix-like system. It is not guaranteed for remote files. And it is even not guaranted, if the local system is Windows: on mounted drives, the returned inode number is 0: (file-attributes "y:/.emacs") => (nil 1 101567 513 (20295 15877) (20234 46272) (20234 46272) 33083 "-rw-rw-rw-" nil 0 (47631 . 5881)) Best regards, Michael.