From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: bug in copy-directory Date: Sun, 30 Jan 2011 11:46:12 +0100 Message-ID: <87sjway8i3.fsf@gmx.de> References: <87ipxaidea.fsf@gmail.com> <87k4hp96g0.fsf@stupidchicken.com> <878vy59ejz.fsf@stupidchicken.com> <87lj23ickn.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1296384397 11243 80.91.229.12 (30 Jan 2011 10:46:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 30 Jan 2011 10:46:37 +0000 (UTC) Cc: emacs-devel@gnu.org, Stefan Monnier , Thierry Volpiatto To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 30 11:46:33 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PjUng-0002GD-52 for ged-emacs-devel@m.gmane.org; Sun, 30 Jan 2011 11:46:32 +0100 Original-Received: from localhost ([127.0.0.1]:37442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjUnf-0000xw-IZ for ged-emacs-devel@m.gmane.org; Sun, 30 Jan 2011 05:46:31 -0500 Original-Received: from [140.186.70.92] (port=52864 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjUnZ-0000xq-JS for emacs-devel@gnu.org; Sun, 30 Jan 2011 05:46:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjUnY-0007Yh-6i for emacs-devel@gnu.org; Sun, 30 Jan 2011 05:46:25 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:54154) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PjUnX-0007Y6-Ql for emacs-devel@gnu.org; Sun, 30 Jan 2011 05:46:24 -0500 Original-Received: (qmail invoked by alias); 30 Jan 2011 10:46:19 -0000 Original-Received: from p57BBC92D.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.201.45] by mail.gmx.net (mp042) with SMTP; 30 Jan 2011 11:46:19 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX18g9iEJ1scgnrGQ96JYU8XBQAQW0Pxc4owoeYaUMj cJLIFF1qL1tSHq In-Reply-To: <87lj23ickn.fsf@stupidchicken.com> (Chong Yidong's message of "Sat, 29 Jan 2011 17:12:40 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 213.165.64.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:135232 Archived-At: Chong Yidong writes: > Stefan Monnier writes: > >> I don't think there's a traditional C-level equivalent to `cp', but at >> least for `mv', the C-level API (aka `rename') does not behave like >> `mv', but instead signals an error if the destination is >> a pre-existing directory. >> >> As Lennart points out, the semantics of `rename' are a bit less magical, >> which tends to work well when you care about race-conditions and other >> fun stuff. OTOH out `copy-file' behaves like `cp', so I guess it's OK >> for copy-directory to also always behave like `cp' even for >> non-interactive uses. > > I've commited the patch to the branch. Dired seems to still work fine. Sorry for coming in late. A year ago, there was the related Bug#5343. I've fixed that. Your patch breaks recursive copy now. Extend the use case from that bug report: - Create directory /tmp/test - Create directory /tmp/test/test - Create file /tmp/test/a - Create file /tmp/test/test/b - Apply (copy-directory "/tmp/test" "~/") Everything is fine - Apply again (copy-directory "/tmp/test" "~/") The target directory structure is broken. > I haven't checked whether the Tramp handlers need fixing, though. When possible, Tramp will use native means for recursive copy. Try (copy-directory "/tmp/test" "/rsync::~/") I would like to keep this behaviour. Best regards, Michael.