diff lisp/dired-aux.el @ 96980:ee7f0d8ed1ab

(dired-copy-file-recursive): Avoid calling set-file-modes when creating target directories.
author Chong Yidong <cyd@stupidchicken.com>
date Thu, 24 Jul 2008 16:12:20 +0000
parents ee5932bf781d
children 6ab215577678
line wrap: on
line diff
--- a/lisp/dired-aux.el	Thu Jul 24 16:12:08 2008 +0000
+++ b/lisp/dired-aux.el	Thu Jul 24 16:12:20 2008 +0000
@@ -1195,9 +1195,13 @@
 	    (if (file-exists-p to)
 		(or top (dired-handle-overwrite to))
 	      (condition-case err
-		  (progn
-		    (make-directory to)
-		    (set-file-modes to #o700))
+		  ;; Create the directory with correct permissions.
+		  (let ((default-mode (default-file-modes)))
+		    (unwind-protect
+			(progn
+			  (set-default-file-modes #o700)
+			  (make-directory to))
+		      (set-default-file-modes default-mode)))
 		(file-error
 		 (push (dired-make-relative from)
 		       dired-create-files-failures)