comparison lisp/dired-aux.el @ 91085:880960b70474

Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-283
author Miles Bader <miles@gnu.org>
date Sun, 11 Nov 2007 00:56:44 +0000
parents 14c4a6aac623 d3e87ee5aa0e
children 53108e6cea98
comparison
equal deleted inserted replaced
91084:a4347a111894 91085:880960b70474
1158 (if (and recursive 1158 (if (and recursive
1159 (eq t (car attrs)) 1159 (eq t (car attrs))
1160 (or (eq recursive 'always) 1160 (or (eq recursive 'always)
1161 (yes-or-no-p (format "Recursive copies of %s? " from)))) 1161 (yes-or-no-p (format "Recursive copies of %s? " from))))
1162 ;; This is a directory. 1162 ;; This is a directory.
1163 (let ((files 1163 (let ((mode (file-modes from))
1164 (files
1164 (condition-case err 1165 (condition-case err
1165 (directory-files from nil dired-re-no-dot) 1166 (directory-files from nil dired-re-no-dot)
1166 (file-error 1167 (file-error
1167 (push (dired-make-relative from) 1168 (push (dired-make-relative from)
1168 dired-create-files-failures) 1169 dired-create-files-failures)
1172 (if (eq recursive 'top) (setq recursive 'always)) ; Don't ask any more. 1173 (if (eq recursive 'top) (setq recursive 'always)) ; Don't ask any more.
1173 (unless dirfailed 1174 (unless dirfailed
1174 (if (file-exists-p to) 1175 (if (file-exists-p to)
1175 (or top (dired-handle-overwrite to)) 1176 (or top (dired-handle-overwrite to))
1176 (condition-case err 1177 (condition-case err
1177 (make-directory to) 1178 (progn
1179 (make-directory to)
1180 (set-file-modes to #o700))
1178 (file-error 1181 (file-error
1179 (push (dired-make-relative from) 1182 (push (dired-make-relative from)
1180 dired-create-files-failures) 1183 dired-create-files-failures)
1181 (setq files nil) 1184 (setq files nil)
1182 (dired-log "Copying error for %s:\n%s\n" from err))))) 1185 (dired-log "Copying error for %s:\n%s\n" from err)))))
1191 thisfrom thisto 1194 thisfrom thisto
1192 ok-flag preserve-time nil recursive) 1195 ok-flag preserve-time nil recursive)
1193 (file-error 1196 (file-error
1194 (push (dired-make-relative thisfrom) 1197 (push (dired-make-relative thisfrom)
1195 dired-create-files-failures) 1198 dired-create-files-failures)
1196 (dired-log "Copying error for %s:\n%s\n" thisfrom err)))))) 1199 (dired-log "Copying error for %s:\n%s\n" thisfrom err)))))
1200 (when (file-directory-p to)
1201 (set-file-modes to mode)))
1197 ;; Not a directory. 1202 ;; Not a directory.
1198 (or top (dired-handle-overwrite to)) 1203 (or top (dired-handle-overwrite to))
1199 (condition-case err 1204 (condition-case err
1200 (if (stringp (car attrs)) 1205 (if (stringp (car attrs))
1201 ;; It is a symlink 1206 ;; It is a symlink