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: Mon, 27 Feb 2012 19:34:21 +0100 Message-ID: <87r4xgkt2b.fsf@gmail.com> References: <87mx9su32g.fsf@web.de> <83vcmws3bs.fsf@gnu.org> <87ehtkwaiz.fsf@gmail.com> <87wr7cgsm3.fsf@gmx.de> <8762eww77b.fsf@gmail.com> <83pqd4roav.fsf@gnu.org> <87haygx97t.fsf@gmx.de> <87aa47rj6z.fsf@gmail.com> <878vjrxpej.fsf@gmx.de> <87pqd3i8ky.fsf@gmail.com> <87ipiuvsbw.fsf@gmx.de> <87k439gyu5.fsf@gmail.com> <87fwdwhizm.fsf@gmail.com> <87bookhfcn.fsf@gmail.com> <87aa44o7qo.fsf@gmail.com> <87ty2c490n.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1330368810 13851 80.91.229.3 (27 Feb 2012 18:53:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 27 Feb 2012 18:53:30 +0000 (UTC) Cc: 10489@debbugs.gnu.org, Michael Albinus To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 27 19:53:26 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S25hN-0006mi-22 for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Feb 2012 19:53:25 +0100 Original-Received: from localhost ([::1]:45721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S25hM-0003SO-ME for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Feb 2012 13:53:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S25hF-0003SD-Ex for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2012 13:53:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S25h9-0003us-7I for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2012 13:53:17 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58207) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S25h9-0003ul-2D for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2012 13:53:11 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S25ju-0005Xh-GZ for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2012 13:56: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: Mon, 27 Feb 2012 18:56: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.133036891221251 (code B ref 10489); Mon, 27 Feb 2012 18:56:02 +0000 Original-Received: (at 10489) by debbugs.gnu.org; 27 Feb 2012 18:55:12 +0000 Original-Received: from localhost ([127.0.0.1]:60104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S25j6-0005Wi-Hc for submit@debbugs.gnu.org; Mon, 27 Feb 2012 13:55:12 -0500 Original-Received: from mail-we0-f172.google.com ([74.125.82.172]:52476) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S25j3-0005WW-Ng for 10489@debbugs.gnu.org; Mon, 27 Feb 2012 13:55:11 -0500 Original-Received: by werb10 with SMTP id b10so1203806wer.3 for <10489@debbugs.gnu.org>; Mon, 27 Feb 2012 10:52:16 -0800 (PST) Received-SPF: pass (google.com: domain of thierry.volpiatto@gmail.com designates 10.216.134.5 as permitted sender) client-ip=10.216.134.5; Authentication-Results: mr.google.com; spf=pass (google.com: domain of thierry.volpiatto@gmail.com designates 10.216.134.5 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.134.5]) by 10.216.134.5 with SMTP id r5mr7740614wei.39.1330368736224 (num_hops = 1); Mon, 27 Feb 2012 10:52:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:date:references:user-agent :message-id:mime-version:content-type; bh=XtUZXHlwGJTsc1pztP/bHxj0CPliNrQ2+VCae5U+f2Y=; b=q/r7NSQMM9K+/rGWb1DRPasjL/9N7VeO674uUBo+BYrjOIheJi1rqJ71LY9fWoXV78 RtUxiqklW+2k8Of7rmUbEGoPrPuqKloJvDE2reQuoBtnxQAm4fNr6C5oHS/+I7jnWUGE XqOBfnGE5Ze7gWFyN+AJO9KEBdx9XG+1UDj1M= Original-Received: by 10.216.134.5 with SMTP id r5mr6146334wei.39.1330368736079; Mon, 27 Feb 2012 10:52:16 -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 er8sm58927498wib.1.2012.02.27.10.52.14 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 27 Feb 2012 10:52:15 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Mon, 27 Feb 2012 12:38:14 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (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:57317 Archived-At: Stefan Monnier writes: >>>> Because if we don't do that, we have to create new directory Test1 and >>>> then test if Test1 is a subdir of Test. >>> No we don't have to do that. We can do the extra work in copy-directory >>> (so we call file-equal-p on "~/test" rather than on "~/test/test1" when >>> "~/test/test1" doesn't exist yet). >> If you don't create test1, you will never have a value of >> file-attributes for it, and file-directory-p will return always nil on >> test1. > > I don't understand why you think that's a problem. It's me who don't understand you, sorry. We want to do: (copy-directory "~/test" "~/test/test1") "~/test/test1" is a non--existing directory. Actually in copy-directory, I create "~/test/test1", and after doing this, I check if this newly created directory is a subdir or "~/test" in which case I exit with error. 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. It's so simple to do at start of function: (file-subdir-of-p "~/test/test1" "~/test" 'noexist) Where the NOEXIST arg allow file-subdir-of-p to bypass the file-directory-p check (who will return nil on "test1"). -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997