Commit 89242dda authored by Juanma Barranquero's avatar Juanma Barranquero

(dired-copy-file-recursive): Preserve directory permissions.

parent 6341c3fc
2007-10-31 Sven Joachim <svenjoac@gmx.de>
* dired-aux.el (dired-copy-file-recursive):
Preserve directory permissions.
2007-10-31 Juanma Barranquero <lekktu@gmail.com>
* whitespace.el (whitespace-write-file-hook): Remove interactive spec.
......@@ -1162,7 +1162,8 @@ Special value `always' suppresses confirmation."
(or (eq recursive 'always)
(yes-or-no-p (format "Recursive copies of %s? " from))))
;; This is a directory.
(let ((files
(let ((mode (file-modes from))
(files
(condition-case err
(directory-files from nil dired-re-no-dot)
(file-error
......@@ -1176,7 +1177,9 @@ Special value `always' suppresses confirmation."
(if (file-exists-p to)
(or top (dired-handle-overwrite to))
(condition-case err
(make-directory to)
(progn
(make-directory to)
(set-file-modes to #o700))
(file-error
(push (dired-make-relative from)
dired-create-files-failures)
......@@ -1195,7 +1198,9 @@ Special value `always' suppresses confirmation."
(file-error
(push (dired-make-relative thisfrom)
dired-create-files-failures)
(dired-log "Copying error for %s:\n%s\n" thisfrom err))))))
(dired-log "Copying error for %s:\n%s\n" thisfrom err)))))
(when (file-directory-p to)
(set-file-modes to mode)))
;; Not a directory.
(or top (dired-handle-overwrite to))
(condition-case err
......@@ -1203,7 +1208,7 @@ Special value `always' suppresses confirmation."
;; It is a symlink
(make-symbolic-link (car attrs) to ok-flag)
(copy-file from to ok-flag dired-copy-preserve-time))
(file-date-error
(file-date-error
(push (dired-make-relative from)
dired-create-files-failures)
(dired-log "Can't set date on %s:\n%s\n" from err))))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment