# HG changeset patch # User Michael Albinus # Date 1246362919 0 # Node ID 11f316dfa4b5a64c6d4e513c7f64b0fc88a1c235 # Parent c9a91925541c9d62b6de690b076f59af0239551e * net/tramp.el (tramp-do-copy-or-rename-file-directly): Handle also the 'rename case, when setting file modes. (Bug#3712) diff -r c9a91925541c -r 11f316dfa4b5 lisp/net/tramp.el --- a/lisp/net/tramp.el Tue Jun 30 02:16:32 2009 +0000 +++ b/lisp/net/tramp.el Tue Jun 30 11:55:19 2009 +0000 @@ -3225,7 +3225,9 @@ as FILENAME. PRESERVE-UID-GID, when non-nil, instructs to keep the uid and gid from FILENAME." (let ((t1 (tramp-tramp-file-p filename)) - (t2 (tramp-tramp-file-p newname))) + (t2 (tramp-tramp-file-p newname)) + (file-times (nth 5 (file-attributes filename))) + (file-modes (tramp-default-file-modes filename))) (with-parsed-tramp-file-name (if t1 filename newname) nil (let* ((cmd (cond ((and (eq op 'copy) preserve-uid-gid) "cp -f -p") ((eq op 'copy) "cp -f") @@ -3364,8 +3366,8 @@ ;; Set the time and mode. Mask possible errors. (condition-case nil (when keep-date - (set-file-times newname (nth 5 (file-attributes filename))) - (set-file-modes newname (tramp-default-file-modes filename))) + (set-file-times newname file-times) + (set-file-modes newname file-modes)) (error))))) (defun tramp-do-copy-or-rename-file-out-of-band (op filename newname keep-date)