Commit 91192f4f authored by Michael Albinus's avatar Michael Albinus

* net/tramp-smb.el (tramp-smb-handle-copy-file)

(tramp-smb-handle-rename-file, tramp-smb-handle-write-region):
Delete temporary file in case of error.
parent ce2cc728
2009-01-05 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-handle-load)
(tramp-do-copy-or-rename-file-directly)
(tramp-handle-file-local-copy, tramp-handle-insert-file-contents)
(tramp-handle-write-region)
* net/tramp-smb.el (tramp-smb-handle-copy-file)
(tramp-smb-handle-rename-file, tramp-smb-handle-write-region):
Delete temporary file in case of error.
2009-01-05 Agustín Martín <agustin.martin@hispalinux.es>
* textmodes/ispell.el (ispell-check-version): Use (with-temp-buffer)
......
......@@ -216,7 +216,10 @@ PRESERVE-UID-GID is completely ignored."
(if tmpfile
;; Remote filename.
(rename-file tmpfile newname ok-if-already-exists)
(condition-case err
(rename-file tmpfile newname ok-if-already-exists)
(error (delete-file tmpfile)
(signal (car err) (cdr err))))
;; Remote newname.
(when (file-directory-p newname)
......@@ -548,10 +551,13 @@ PRESERVE-UID-GID is completely ignored."
(let ((tmpfile (file-local-copy filename)))
(if tmpfile
;; remote filename
(rename-file tmpfile newname ok-if-already-exists)
;; Remote filename.
(condition-case err
(rename-file tmpfile newname ok-if-already-exists)
(error (delete-file tmpfile)
(signal (car err) (cdr err))))
;; remote newname
;; Remote newname.
(when (file-directory-p newname)
(setq newname (expand-file-name
(file-name-nondirectory filename) newname)))
......@@ -618,12 +624,13 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
(list start end tmpfile append 'no-message lockname)))
(tramp-message v 5 "Writing tmp file %s to file %s..." tmpfile filename)
(if (tramp-smb-send-command v (format "put %s \"%s\"" tmpfile file))
(tramp-message
v 5 "Writing tmp file %s to file %s...done" tmpfile filename)
(tramp-error v 'file-error "Cannot write `%s'" filename))
(unwind-protect
(if (tramp-smb-send-command v (format "put %s \"%s\"" tmpfile file))
(tramp-message
v 5 "Writing tmp file %s to file %s...done" tmpfile filename)
(tramp-error v 'file-error "Cannot write `%s'" filename))
(delete-file tmpfile))
(delete-file tmpfile)
(unless (equal curbuf (current-buffer))
(tramp-error
v 'file-error
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment