help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs lisp command to copy dir and all subdir?


From: Xah Lee
Subject: Re: emacs lisp command to copy dir and all subdir?
Date: Thu, 27 Aug 2009 08:21:37 -0700 (PDT)
User-agent: G2/1.0

On Aug 26, 5:32 am, Michael Heerdegen <nore...@nospam.dev.null> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]