[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Recursive copies in dired abort on first error
From: |
Richard Stallman |
Subject: |
Re: Recursive copies in dired abort on first error |
Date: |
Sun, 03 Sep 2006 11:17:23 -0400 |
How about this patch, instead of the other?
It should display an indication that there was a problem.
I tested that it compiles, but it isn't convenient for me to try running it;
could you please?
*** dired-aux.el 17 Jul 2006 16:31:56 -0400 1.146
--- dired-aux.el 03 Sep 2006 07:43:15 -0400
***************
*** 1142,1155 ****
(rename-file to backup 0) ; confirm overwrite of old backup
(dired-relist-entry backup)))))
;;;###autoload
(defun dired-copy-file (from to ok-flag)
(dired-handle-overwrite to)
(condition-case ()
! (dired-copy-file-recursive from to ok-flag dired-copy-preserve-time t
! dired-recursive-copies)
! (file-date-error (message "Can't set date")
! (sit-for 1))))
(defun dired-copy-file-recursive (from to ok-flag &optional
preserve-time top recursive)
--- 1142,1160 ----
(rename-file to backup 0) ; confirm overwrite of old backup
(dired-relist-entry backup)))))
+ (defvar dired-copy-file-failures)
+
;;;###autoload
(defun dired-copy-file (from to ok-flag)
(dired-handle-overwrite to)
(condition-case ()
! (let (dired-copy-file-failures)
! (progn
! (dired-copy-file-recursive from to ok-flag dired-copy-preserve-time t
! dired-recursive-copies)
! (if dired-copy-file-failures
! (dired-log-summary "Failed copies" dired-copy-file-failures))))
! ))
(defun dired-copy-file-recursive (from to ok-flag &optional
preserve-time top recursive)
***************
*** 1163,1181 ****
(if (eq recursive 'top) (setq recursive 'always)) ; Don't ask any
more.
(if (file-exists-p to)
(or top (dired-handle-overwrite to))
! (make-directory to))
(while files
(dired-copy-file-recursive
(expand-file-name (car files) from)
(expand-file-name (car files) to)
ok-flag preserve-time nil recursive)
! (setq files (cdr files))))
;; Not a directory.
(or top (dired-handle-overwrite to))
! (if (stringp (car attrs))
! ;; It is a symlink
! (make-symbolic-link (car attrs) to ok-flag)
! (copy-file from to ok-flag dired-copy-preserve-time)))))
;;;###autoload
(defun dired-rename-file (file newname ok-if-already-exists)
--- 1168,1200 ----
(if (eq recursive 'top) (setq recursive 'always)) ; Don't ask any
more.
(if (file-exists-p to)
(or top (dired-handle-overwrite to))
! (condition-case err
! (make-directory to)
! (file-error
! (push (dired-make-relative from)
! dired-copy-file-failures)
! (dired-log "Copying error for %s:\n%s\n" from err))))
(while files
(dired-copy-file-recursive
(expand-file-name (car files) from)
(expand-file-name (car files) to)
ok-flag preserve-time nil recursive)
! (pop files)))
;; Not a directory.
(or top (dired-handle-overwrite to))
! (condition-case err
! (if (stringp (car attrs))
! ;; 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
! (push (dired-make-relative from)
! dired-copy-file-failures)
! (dired-log "Can't set date on %s:\n%s\n" from err))
! (file-error
! (push (dired-make-relative from)
! dired-copy-file-failures)
! (dired-log "Copying error for %s:\n%s\n" from err))))))
;;;###autoload
(defun dired-rename-file (file newname ok-if-already-exists)
- Re: Recursive copies in dired abort on first error,
Richard Stallman <=
- Re: Recursive copies in dired abort on first error, Sven Joachim, 2006/09/03
- Re: Recursive copies in dired abort on first error, Richard Stallman, 2006/09/04
- Re: Recursive copies in dired abort on first error, Sven Joachim, 2006/09/05
- Re: Recursive copies in dired abort on first error, Richard Stallman, 2006/09/06
- Re: Recursive copies in dired abort on first error, Sven Joachim, 2006/09/06
- Re: Recursive copies in dired abort on first error, Richard Stallman, 2006/09/07
- Re: Recursive copies in dired abort on first error, Sven Joachim, 2006/09/08
- Re: Recursive copies in dired abort on first error, Richard Stallman, 2006/09/09
- Re: Recursive copies in dired abort on first error, Sven Joachim, 2006/09/09