changeset 80631:61057537aad3

(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:16:00 +0000
parents 9c4d808c7b66
children df91f4deb39e
files lisp/dired-aux.el
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/dired-aux.el	Thu Jul 24 16:14:50 2008 +0000
+++ b/lisp/dired-aux.el	Thu Jul 24 16:16:00 2008 +0000
@@ -1180,9 +1180,15 @@
 	    (if (file-exists-p to)
 		(or top (dired-handle-overwrite to))
 	      (condition-case err
-		  (progn
-		    (make-directory to)
-		    (set-file-modes to #o700))
+		  ;; We used to call set-file-modes here, but on some
+		  ;; Linux kernels, that returns an error on vfat
+		  ;; filesystems
+		  (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)