From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Xah Lee" Newsgroups: gmane.emacs.bugs Subject: bug#4416: 23.1; suggestion: a elisp function for copying and deleting whole dir Date: Fri, 11 Sep 2009 22:21:00 -0700 Message-ID: <24BBDB8B62A14886882A9A4191E65E14@xahPC> Reply-To: Xah Lee , 4416@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=response Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1252738645 11967 80.91.229.12 (12 Sep 2009 06:57:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Sep 2009 06:57:25 +0000 (UTC) To: Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 12 08:57:18 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MmMXt-0001hP-PP for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Sep 2009 08:57:18 +0200 Original-Received: from localhost ([127.0.0.1]:57029 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmMXt-0004TE-6f for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Sep 2009 02:57:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmL8h-0006dn-8a for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2009 01:27:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmL8Z-0006bl-OU for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2009 01:27:10 -0400 Original-Received: from [199.232.76.173] (port=37319 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmL8Z-0006bU-22 for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2009 01:27:03 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:48904) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MmL8Y-0001oD-Dn for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2009 01:27:02 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8C5QxJ3019921; Fri, 11 Sep 2009 22:26:59 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8C5P9P3019589; Fri, 11 Sep 2009 22:25:09 -0700 Resent-Date: Fri, 11 Sep 2009 22:25:09 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Xah Lee" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Sat, 12 Sep 2009 05:25:08 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4416 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125273288219031 (code B ref -1); Sat, 12 Sep 2009 05:25:08 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 12 Sep 2009 05:21:22 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8C5LLhB019028 for ; Fri, 11 Sep 2009 22:21:22 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmL32-0005Hc-FM for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2009 01:21:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmL31-0005Gi-Cq for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2009 01:21:19 -0400 Original-Received: from [199.232.76.173] (port=34898 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmL30-0005GK-Qf for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2009 01:21:19 -0400 Original-Received: from mout.perfora.net ([74.208.4.195]:53313) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MmL30-0001DA-HN for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2009 01:21:18 -0400 Original-Received: from xahPC (c-76-102-12-87.hsd1.ca.comcast.net [76.102.12.87]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0MKp8S-1MmL2q3xZQ-000ObH; Sat, 12 Sep 2009 01:21:10 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6002.18005 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18005 X-Provags-ID: V01U2FsdGVkX19N45UgrVsXxNu8MBEN/3KY033fKxacEQyXp5l WQ1UdvkKZD/y0ci2Bq4JJSB6tb+gGcmOS+NK7EV208+hnl/lWT EAtu3meu4P1Zov3F92Byg== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-MIME-Autoconverted: from 8bit to quoted-printable by rzlab.ucr.edu id n8C5QxJ3019921 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sat, 12 Sep 2009 01:27:09 -0400 X-Mailman-Approved-At: Sat, 12 Sep 2009 02:57:13 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31003 Archived-At: here's my draft implementation. (thanks to Andreas Politz who pointed out= =20 the dired-aux function) (defun copy-directory-recursive (source-dir dest-dir) "Copy whole a directory SOURCE-DIR to DEST-DIR. Note, the semantics of source-dir dest-dir is different from the unix =E2= =80=9Ccp=E2=80=9D=20 utility. In unix's =E2=80=9Ccp -R=E2=80=9D, if dest-dir exists, it'll copy source-= dir itself, else,=20 just source-dir's children. In copy-directory-recursive, it always copy source-dir's children. In both, the dest-dir may or may not exist. If not, it'll be created.=20 However, dest-dir's parent must exist. This function is based on dired-copy-file-recursive. Behavior about linked files, etc, are from that function." (require 'dired-aux) (dired-copy-file-recursive source-dir dest-dir nil nil nil 'always) ) haven't worked on delete-directory-recursive yet... Xah =E2=88=91 http://xahlee.org/ =E2=98=84=20