1135 |
|
|
1136 |
(defun dired-copy-file-recursive (from to ok-flag &optional |
(defun dired-copy-file-recursive (from to ok-flag &optional |
1137 |
preserve-time top recursive) |
preserve-time top recursive) |
1138 |
(if (and recursive |
(let ((attrs (file-attributes from))) |
1139 |
(eq t (car (file-attributes from))) ; A directory, no symbolic link. |
(if (and recursive |
1140 |
(or (eq recursive 'always) |
(eq t (car attrs)) |
1141 |
(yes-or-no-p (format "Recursive copies of %s " from)))) |
(or (eq recursive 'always) |
1142 |
(let ((files (directory-files from nil dired-re-no-dot))) |
(yes-or-no-p (format "Recursive copies of %s " from)))) |
1143 |
(if (eq recursive 'top) (setq recursive 'always)) ; Don't ask any more. |
;; This is a directory. |
1144 |
(if (file-exists-p to) |
(let ((files (directory-files from nil dired-re-no-dot))) |
1145 |
(or top (dired-handle-overwrite to)) |
(if (eq recursive 'top) (setq recursive 'always)) ; Don't ask any more. |
1146 |
(make-directory to)) |
(if (file-exists-p to) |
1147 |
(while files |
(or top (dired-handle-overwrite to)) |
1148 |
(dired-copy-file-recursive |
(make-directory to)) |
1149 |
(expand-file-name (car files) from) |
(while files |
1150 |
(expand-file-name (car files) to) |
(dired-copy-file-recursive |
1151 |
ok-flag preserve-time nil recursive) |
(expand-file-name (car files) from) |
1152 |
(setq files (cdr files)))) |
(expand-file-name (car files) to) |
1153 |
(or top (dired-handle-overwrite to)) ; Just a file. |
ok-flag preserve-time nil recursive) |
1154 |
(copy-file from to ok-flag dired-copy-preserve-time))) |
(setq files (cdr files)))) |
1155 |
|
;; Not a directory. |
1156 |
|
(or top (dired-handle-overwrite to)) |
1157 |
|
(if (stringp (car attrs)) |
1158 |
|
;; It is a symlink |
1159 |
|
(make-symbolic-link (car attrs) to ok-flag) |
1160 |
|
(copy-file from to ok-flag dired-copy-preserve-time))))) |
1161 |
|
|
1162 |
;;;###autoload |
;;;###autoload |
1163 |
(defun dired-rename-file (file newname ok-if-already-exists) |
(defun dired-rename-file (file newname ok-if-already-exists) |