From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Tramp and recursive file operations Date: Wed, 30 Sep 2009 15:56:41 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1254345997 9635 80.91.229.12 (30 Sep 2009 21:26:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Sep 2009 21:26:37 +0000 (UTC) Cc: "tramp-devel@gnu.org" , "emacs-devel@gnu.org" To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 30 23:26:30 2009 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.50) id 1Mt6gH-0003yv-E3 for ged-emacs-devel@m.gmane.org; Wed, 30 Sep 2009 23:25:49 +0200 Original-Received: from localhost ([127.0.0.1]:36331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mt6gG-0001u3-Lo for ged-emacs-devel@m.gmane.org; Wed, 30 Sep 2009 17:25:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mt5I8-0001W4-IJ for emacs-devel@gnu.org; Wed, 30 Sep 2009 15:56:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mt5I4-0001U0-WA for emacs-devel@gnu.org; Wed, 30 Sep 2009 15:56:48 -0400 Original-Received: from [199.232.76.173] (port=57225 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mt5I4-0001Tr-Nw; Wed, 30 Sep 2009 15:56:44 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:36046 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mt5I4-0005b3-AM; Wed, 30 Sep 2009 15:56:44 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAH9Uw0pMCrXH/2dsb2JhbACBUNcwhCcEhw8 X-IronPort-AV: E=Sophos;i="4.44,481,1249272000"; d="scan'208";a="46865040" Original-Received: from 76-10-181-199.dsl.teksavvy.com (HELO pastel.home) ([76.10.181.199]) by ironport2-out.pppoe.ca with ESMTP; 30 Sep 2009 15:56:42 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 487C68109; Wed, 30 Sep 2009 15:56:41 -0400 (EDT) In-Reply-To: (Michael Albinus's message of "Wed, 30 Sep 2009 16:07:14 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:115812 Archived-At: >>> OK. Looking outside dired, there is already delete-directory, good for >>> empty directories. Maybe we add an optional parameter RECURSIVE? >> Sounds OK, except for the fact that delete-directory is implemented in >> C, so you'd have to code the recursion in C as well. > I've seen that. I'll do my best ... Maybe the best option is to rename delete-directory to delete-directory-internal and then implement a new delete-directory in files.el. using it. >>> A copy-directory function does not exist. What about allowing the first >>> parameter of copy-file to be a directory name? This would imply to copy >>> recursively. >> If we were starting over from scratch, that would be fine, but I'm >> afraid that some code somewhere relies on the fact that copy-file only >> copies files and not directories. And of course, copy-file is also >> implemented in C, so you'd have to code the recursion in C as well. > So we go with copy-directory? Just DIRNAME and NEWNAME as parameters, or > the other ones from copy-file as well? Whenever I copy a directory, I always use "cp -a", so I'd be tempted to say that additional args aren't needed, but that the behavior should preserve as much as we can (symlinks, gid, mtime, you name it). > I guess that we dont't need OK-IF-ALREADY-EXISTS, because if directory > NEWNAME already exists, we create a subdirectory. I'd tend to disagree here: this kind of behavior is very handy interactively, but not when called from Lisp code, where you might prefer an error (at which point you can then choose to call copy-directory again to the subdirectory, or you may prefer to overlay the copy on top of the existing tree, tho we don't have any code that does it for us yet). Stefan