aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2020-03-28 12:59:03 +0100
committerMichael Albinus2020-03-28 12:59:03 +0100
commite6c6486ee0b4e50c61c062f475bbe473cfd397f9 (patch)
tree92d85c10f4c532f7f1ab910cd50ab3712ac96866
parent90b6ba0a1697c07a668be1776f22246470682724 (diff)
downloademacs-e6c6486ee0b4e50c61c062f475bbe473cfd397f9.tar.gz
emacs-e6c6486ee0b4e50c61c062f475bbe473cfd397f9.zip
Tramp cache fixes
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Flush the cache after the file has been written.
-rw-r--r--lisp/net/tramp-adb.el7
-rw-r--r--lisp/net/tramp-smb.el7
2 files changed, 8 insertions, 6 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index bfeaebac2cd..4512179eb14 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -629,9 +629,6 @@ But handle the case, if the \"test\" command is not available."
629 (format "File %s exists; overwrite anyway? " filename))))) 629 (format "File %s exists; overwrite anyway? " filename)))))
630 (tramp-error v 'file-already-exists filename)) 630 (tramp-error v 'file-already-exists filename))
631 631
632 ;; We must also flush the cache of the directory, because
633 ;; `file-attributes' reads the values from there.
634 (tramp-flush-file-properties v localname)
635 (let* ((curbuf (current-buffer)) 632 (let* ((curbuf (current-buffer))
636 (tmpfile (tramp-compat-make-temp-file filename))) 633 (tmpfile (tramp-compat-make-temp-file filename)))
637 (when (and append (file-exists-p filename)) 634 (when (and append (file-exists-p filename))
@@ -648,6 +645,10 @@ But handle the case, if the \"test\" command is not available."
648 (tramp-error v 'file-error "Cannot write: `%s'" filename)) 645 (tramp-error v 'file-error "Cannot write: `%s'" filename))
649 (delete-file tmpfile))) 646 (delete-file tmpfile)))
650 647
648 ;; We must also flush the cache of the directory, because
649 ;; `file-attributes' reads the values from there.
650 (tramp-flush-file-properties v localname)
651
651 (unless (equal curbuf (current-buffer)) 652 (unless (equal curbuf (current-buffer))
652 (tramp-error 653 (tramp-error
653 v 'file-error 654 v 'file-error
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index effac333dad..100ddfaa681 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1557,9 +1557,6 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
1557 (format "File %s exists; overwrite anyway? " filename))))) 1557 (format "File %s exists; overwrite anyway? " filename)))))
1558 (tramp-error v 'file-already-exists filename)) 1558 (tramp-error v 'file-already-exists filename))
1559 1559
1560 ;; We must also flush the cache of the directory, because
1561 ;; `file-attributes' reads the values from there.
1562 (tramp-flush-file-properties v localname)
1563 (let ((curbuf (current-buffer)) 1560 (let ((curbuf (current-buffer))
1564 (tmpfile (tramp-compat-make-temp-file filename))) 1561 (tmpfile (tramp-compat-make-temp-file filename)))
1565 (when (and append (file-exists-p filename)) 1562 (when (and append (file-exists-p filename))
@@ -1579,6 +1576,10 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
1579 (tramp-error v 'file-error "Cannot write `%s'" filename)) 1576 (tramp-error v 'file-error "Cannot write `%s'" filename))
1580 (delete-file tmpfile))) 1577 (delete-file tmpfile)))
1581 1578
1579 ;; We must also flush the cache of the directory, because
1580 ;; `file-attributes' reads the values from there.
1581 (tramp-flush-file-properties v localname)
1582
1582 (unless (equal curbuf (current-buffer)) 1583 (unless (equal curbuf (current-buffer))
1583 (tramp-error 1584 (tramp-error
1584 v 'file-error 1585 v 'file-error