From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy Date: Fri, 24 Feb 2012 14:36:11 +0100 Message-ID: <87mx88wdys.fsf@gmail.com> References: <87mx9su32g.fsf@web.de> <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> <87haygie87.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1330090676 31427 80.91.229.3 (24 Feb 2012 13:37:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 24 Feb 2012 13:37:56 +0000 (UTC) Cc: 10489@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 24 14:37:54 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S0vLH-0005p1-4H for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Feb 2012 14:37:47 +0100 Original-Received: from localhost ([::1]:42084 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0vLG-0000PZ-Kc for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Feb 2012 08:37:46 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:33333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0vLB-0000PJ-GE for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2012 08:37:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0vL5-00038P-OV for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2012 08:37:40 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0vL5-00037z-My for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2012 08:37:35 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S0vNS-0006qh-4k for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2012 08:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Feb 2012 13:40: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.133009074626236 (code B ref 10489); Fri, 24 Feb 2012 13:40:02 +0000 Original-Received: (at 10489) by debbugs.gnu.org; 24 Feb 2012 13:39:06 +0000 Original-Received: from localhost ([127.0.0.1]:53538 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0vMQ-0006oj-Oq for submit@debbugs.gnu.org; Fri, 24 Feb 2012 08:39:04 -0500 Original-Received: from mail-ww0-f46.google.com ([74.125.82.46]:63502) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0vMM-0006oO-Lk for 10489@debbugs.gnu.org; Fri, 24 Feb 2012 08:38:56 -0500 Original-Received: by wgbdt14 with SMTP id dt14so1932566wgb.15 for <10489@debbugs.gnu.org>; Fri, 24 Feb 2012 05:36:15 -0800 (PST) Received-SPF: pass (google.com: domain of thierry.volpiatto@gmail.com designates 10.216.137.147 as permitted sender) client-ip=10.216.137.147; Authentication-Results: mr.google.com; spf=pass (google.com: domain of thierry.volpiatto@gmail.com designates 10.216.137.147 as permitted sender) smtp.mail=thierry.volpiatto@gmail.com; dkim=pass header.i=thierry.volpiatto@gmail.com Original-Received: from mr.google.com ([10.216.137.147]) by 10.216.137.147 with SMTP id y19mr1282855wei.5.1330090575146 (num_hops = 1); Fri, 24 Feb 2012 05:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=How/DWp7AJVyxTB2oQMfXeF99mnq0LoRc/gBzS4tFig=; b=cKvU0pVbfqnp9fvKCEWfOumvoPYl3BYRclh7ibb78JgaXivLJzyL0Y2H309u1wJToF quIeplPTUhYrz+HPuINBZhahPTrZ9PJrfjMJBcoyYe1xYTTMHW8g76AS01s5DqWyAuh0 CDVh0kUSSilSYwEFqnsdx13RnnRCtBrUQwdQg= Original-Received: by 10.216.137.147 with SMTP id y19mr1027881wei.5.1330090575027; Fri, 24 Feb 2012 05:36:15 -0800 (PST) Original-Received: from thierry-MM061 (lbe83-2-78-243-104-167.fbx.proxad.net. [78.243.104.167]) by mx.google.com with ESMTPS id m16sm8587752wie.9.2012.02.24.05.36.12 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Feb 2012 05:36:14 -0800 (PST) In-Reply-To: <87haygie87.fsf@gmx.de> (Michael Albinus's message of "Fri, 24 Feb 2012 13:54:16 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) 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:57166 Archived-At: Hi Michael, Michael Albinus writes: > 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. Do you mean something like in copy-directory: --8<---------------cut here---------------start------------->8--- (let ((handler (or (find-file-name-handler directory 'copy-directory) (find-file-name-handler newname 'copy-directory)))) (if handler (funcall handler 'copy-directory directory newname keep-time parents) --8<---------------cut here---------------end--------------->8--- >> +(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: That annoying because the solution proposed by Stephane (stopping the loop before being infinite) is based on Inode comparison, at least as I have implemented it. > (file-attributes "y:/.emacs") > => (nil 1 101567 513 (20295 15877) (20234 46272) (20234 46272) 33083 "-rw-rw-rw-" nil 0 (47631 . 5881)) So what do you propose for such a case? -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997