Skip to content

Instantly share code, notes, and snippets.

@snmsts
Created June 14, 2013 02:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snmsts/5778947 to your computer and use it in GitHub Desktop.
Save snmsts/5778947 to your computer and use it in GitHub Desktop.
copy-directory
(defun copy-directory (from to &key overwrite)
(let ((len (length (namestring (truename from)))))
(cl-fad:walk-directory
from
(lambda (x)
(cl-fad:copy-file
x
(ensure-directories-exist
(merge-pathnames
(subseq (namestring x) len)
to)) :overwrite overwrite)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment