emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/net/tramp-ftp.el,v


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/net/tramp-ftp.el,v
Date: Sun, 18 Nov 2007 10:24:53 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       07/11/18 10:24:52

Index: net/tramp-ftp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp-ftp.el,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- net/tramp-ftp.el    7 Nov 2007 20:41:14 -0000       1.22
+++ net/tramp-ftp.el    18 Nov 2007 10:24:51 -0000      1.23
@@ -152,6 +152,7 @@
              (aset v 0 tramp-ftp-method)
              (tramp-set-connection-property v "started" t))
          nil))
+
        ;; If the second argument of `copy-file' or `rename-file' is a
        ;; remote file name but via FTP, ange-ftp doesn't check this.
        ;; We must copy it locally first, because there is no place in
@@ -163,8 +164,16 @@
               (newname (cadr args))
               (tmpfile (tramp-compat-make-temp-file filename))
               (args (cddr args)))
-         (apply operation filename tmpfile args)
-         (rename-file tmpfile newname (car args))))
+         ;; We must set `ok-if-already-exists' to t in the first
+         ;; step, because the temp file has been created already.
+         (if (eq operation 'copy-file)
+             (apply operation filename tmpfile t (cdr args))
+           (apply operation filename tmpfile t))
+         (unwind-protect
+             (rename-file tmpfile newname (car args))
+           ;; Cleanup.
+           (ignore-errors (delete-file tmpfile)))))
+
        ;; Normally, the handlers must be discarded.
        (t (let* ((inhibit-file-name-handlers
                  (list 'tramp-file-name-handler




reply via email to

[Prev in Thread] Current Thread [Next in Thread]