unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4416: 23.1; suggestion: a elisp function for copying and deleting whole dir
@ 2009-09-12  5:21 Xah Lee
  2009-09-12 11:56 ` bug#4408: " Juanma Barranquero
  0 siblings, 1 reply; 4+ messages in thread
From: Xah Lee @ 2009-09-12  5:21 UTC (permalink / raw)
  To: bug-gnu-emacs

here's my draft implementation. (thanks to Andreas Politz who pointed out 
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 “cp” 
utility.
In unix's “cp -R”, if dest-dir exists, it'll copy source-dir itself, else, 
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. 
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
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-06  7:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-12  5:21 bug#4416: 23.1; suggestion: a elisp function for copying and deleting whole dir Xah Lee
2009-09-12 11:56 ` bug#4408: " Juanma Barranquero
2009-09-12 12:26   ` Xah Lee
2011-10-06  7:08   ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).