]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp.el (tramp-do-copy-or-rename-file-directly): Handle
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 30 Jun 2009 11:55:41 +0000 (11:55 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 30 Jun 2009 11:55:41 +0000 (11:55 +0000)
also the 'rename case, when setting file modes.  (Bug#3712)

lisp/ChangeLog
lisp/net/tramp.el

index f65bb546be70fcfbe74d5d793b897fa8deef6bd0..037e0981c713c089a73188241dcac25e8b3e1c89 100644 (file)
@@ -1,3 +1,8 @@
+2009-06-30  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el (tramp-do-copy-or-rename-file-directly): Handle
+       also the 'rename case, when setting file modes.  (Bug#3712)
+
 2009-06-30  Kenichi Handa  <handa@m17n.org>
 
        * international/fontset.el (setup-default-fontset): Add CJK fonts
index be41858a7b1f5cb48e0b9d2988a2cc8e5b2b55ef..9da9e314cd2c0e4a2699b547d93d7256add2edbd 100644 (file)
@@ -3225,7 +3225,9 @@ KEEP-DATE means to make sure that NEWNAME has the same timestamp
 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 @@ the uid and gid from FILENAME."
       ;; 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)