From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: emacs lisp command to copy dir and all subdir? Date: Thu, 27 Aug 2009 08:21:37 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3f95a999-b052-4d7f-a4a0-38bb1852c4ae@2g2000prl.googlegroups.com> References: <9eca862e-3e82-4a51-b92b-6ddbe867c188@p10g2000prm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1251431863 2423 80.91.229.12 (28 Aug 2009 03:57:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Aug 2009 03:57:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 28 05:57:37 2009 Return-path: Envelope-to: geh-help-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 1Mgsal-000348-A1 for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Aug 2009 05:57:35 +0200 Original-Received: from localhost ([127.0.0.1]:60313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mgsak-0000Yr-RK for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Aug 2009 23:57:34 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!2g2000prl.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: 76.102.12.87 Original-X-Trace: posting.google.com 1251386497 15679 127.0.0.1 (27 Aug 2009 15:21:37 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 27 Aug 2009 15:21:37 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 2g2000prl.googlegroups.com; posting-host=76.102.12.87; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.39 Safari/530.5, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:172448 X-Mailman-Approved-At: Thu, 27 Aug 2009 23:54:34 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:67601 Archived-At: On Aug 26, 5:32 am, Michael Heerdegen wrote: > Have a look at the doc of `dired-recursive-copies'. sorry all, but a bit clarification. i needed a copy-dir function for elisp coding, not as user function in dired. i haven't thought about looking into how dired-do-copy implement it, good thought. thanks. looking into it, it seems a bit complex: (defun dired-do-copy (&optional arg) "Copy all marked (or next ARG) files, or copy the current file. This normally preserves the last-modified date when copying. When operating on just the current file, you specify the new name. When operating on multiple or marked files, you specify a directory, and new copies of these files are made in that directory with the same names that the files currently have. The default suggested for the target directory depends on the value of `dired-dwim-target', which see. This command copies symbolic links by creating new ones, like `cp -d'." (interactive "P") (let ((dired-recursive-copies dired-recursive-copies)) (dired-do-create-files 'copy (function dired-copy-file) "Copy" arg dired-keep-marker-copy nil dired-copy-how-to-fn))) is this the only way? i think most modern scripting lang has a copy dir function... that'd be good in elisp. Xah