diff options
| author | Michael Albinus | 2017-12-12 15:46:17 +0100 |
|---|---|---|
| committer | Michael Albinus | 2017-12-12 15:46:17 +0100 |
| commit | 95a2a74d0e8d54b32c57800661d77e3de57c53bb (patch) | |
| tree | 6d582375b6f65c890db86164b2b6a1b6ce62ed10 | |
| parent | 489d6466372f488adc53897435fff290394b62f7 (diff) | |
| download | emacs-95a2a74d0e8d54b32c57800661d77e3de57c53bb.tar.gz emacs-95a2a74d0e8d54b32c57800661d77e3de57c53bb.zip | |
Extend tramp-cache.el interface
* lisp/net/tramp.el (tramp-handle-add-name-to-file)
(tramp-handle-dired-uncache):
* lisp/net/tramp-adb.el (tramp-adb-handle-make-directory)
(tramp-adb-handle-delete-directory, tramp-adb-handle-delete-file)
(tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes)
(tramp-adb-handle-set-file-times, tramp-adb-handle-copy-file)
(tramp-adb-handle-rename-file, tramp-adb-handle-process-file)
(tramp-adb-handle-start-file-process, tramp-adb-get-device)
(tramp-adb-maybe-open-connection):
* lisp/net/tramp-cache.el (tramp-flush-file-properties)
(tramp-flush-directory-properties, tramp-flush-file-function):
* lisp/net/tramp-cmds.el (tramp-cleanup-connection):
* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file)
(tramp-gvfs-handle-delete-directory, tramp-gvfs-handle-delete-file)
(tramp-gvfs-handle-file-system-info, tramp-gvfs-handle-make-directory)
(tramp-gvfs-handle-write-region, tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-send-command):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link)
(tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times)
(tramp-sh-handle-set-file-selinux-context, tramp-sh-handle-set-file-acl)
(tramp-sh-handle-add-name-to-file, tramp-sh-handle-copy-directory)
(tramp-do-copy-or-rename-file, tramp-do-copy-or-rename-file-out-of-band)
(tramp-sh-handle-make-directory, tramp-sh-handle-delete-directory)
(tramp-sh-handle-delete-file, tramp-sh-handle-dired-compress-file)
(tramp-process-sentinel, tramp-sh-handle-start-file-process)
(tramp-sh-handle-process-file, tramp-sh-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-add-name-to-file)
(tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file)
(tramp-smb-handle-delete-directory, tramp-smb-handle-delete-file)
(tramp-smb-handle-file-acl, tramp-smb-handle-make-directory-internal)
(tramp-smb-handle-make-symbolic-link, tramp-smb-handle-process-file)
(tramp-smb-handle-rename-file, tramp-smb-handle-set-file-acl)
(tramp-smb-handle-set-file-modes, tramp-smb-handle-start-file-process)
(tramp-smb-handle-write-region, tramp-smb-maybe-open-connection):
Use them.
* lisp/net/tramp-cache.el (tramp-flush-file-properties)
(tramp-flush-directory-properties, tramp-flush-connection-properties):
Rename from `tramp-flush-file-property',`tramp-flush-directory-property'
and `tramp-flush-connection-property', respectively.
(tramp-flush-file-property, tramp-flush-connection-property):
New defuns.
| -rw-r--r-- | lisp/net/tramp-adb.el | 55 | ||||
| -rw-r--r-- | lisp/net/tramp-cache.el | 44 | ||||
| -rw-r--r-- | lisp/net/tramp-cmds.el | 6 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 32 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 65 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 74 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 6 |
7 files changed, 158 insertions, 124 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index f1753cec53e..d06031f1a67 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -541,8 +541,8 @@ Emacs dired can't find files." | |||
| 541 | (let ((par (expand-file-name ".." dir))) | 541 | (let ((par (expand-file-name ".." dir))) |
| 542 | (unless (file-directory-p par) | 542 | (unless (file-directory-p par) |
| 543 | (make-directory par parents)))) | 543 | (make-directory par parents)))) |
| 544 | (tramp-flush-file-property v (file-name-directory localname)) | 544 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 545 | (tramp-flush-directory-property v localname) | 545 | (tramp-flush-directory-properties v localname) |
| 546 | (unless (or (tramp-adb-send-command-and-check | 546 | (unless (or (tramp-adb-send-command-and-check |
| 547 | v (format "mkdir %s" (tramp-shell-quote-argument localname))) | 547 | v (format "mkdir %s" (tramp-shell-quote-argument localname))) |
| 548 | (and parents (file-directory-p dir))) | 548 | (and parents (file-directory-p dir))) |
| @@ -552,11 +552,11 @@ Emacs dired can't find files." | |||
| 552 | "Like `delete-directory' for Tramp files." | 552 | "Like `delete-directory' for Tramp files." |
| 553 | (setq directory (expand-file-name directory)) | 553 | (setq directory (expand-file-name directory)) |
| 554 | (with-parsed-tramp-file-name (file-truename directory) nil | 554 | (with-parsed-tramp-file-name (file-truename directory) nil |
| 555 | (tramp-flush-file-property v (file-name-directory localname)) | 555 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 556 | (tramp-flush-directory-property v localname)) | 556 | (tramp-flush-directory-properties v localname)) |
| 557 | (with-parsed-tramp-file-name directory nil | 557 | (with-parsed-tramp-file-name directory nil |
| 558 | (tramp-flush-file-property v (file-name-directory localname)) | 558 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 559 | (tramp-flush-directory-property v localname) | 559 | (tramp-flush-directory-properties v localname) |
| 560 | (tramp-adb-barf-unless-okay | 560 | (tramp-adb-barf-unless-okay |
| 561 | v (format "%s %s" | 561 | v (format "%s %s" |
| 562 | (if recursive "rm -r" "rmdir") | 562 | (if recursive "rm -r" "rmdir") |
| @@ -567,8 +567,8 @@ Emacs dired can't find files." | |||
| 567 | "Like `delete-file' for Tramp files." | 567 | "Like `delete-file' for Tramp files." |
| 568 | (setq filename (expand-file-name filename)) | 568 | (setq filename (expand-file-name filename)) |
| 569 | (with-parsed-tramp-file-name filename nil | 569 | (with-parsed-tramp-file-name filename nil |
| 570 | (tramp-flush-file-property v (file-name-directory localname)) | 570 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 571 | (tramp-flush-file-property v localname) | 571 | (tramp-flush-file-properties v localname) |
| 572 | (tramp-adb-barf-unless-okay | 572 | (tramp-adb-barf-unless-okay |
| 573 | v (format "rm %s" (tramp-shell-quote-argument localname)) | 573 | v (format "rm %s" (tramp-shell-quote-argument localname)) |
| 574 | "Couldn't delete %s" filename))) | 574 | "Couldn't delete %s" filename))) |
| @@ -661,8 +661,8 @@ But handle the case, if the \"test\" command is not available." | |||
| 661 | 661 | ||
| 662 | ;; We must also flush the cache of the directory, because | 662 | ;; We must also flush the cache of the directory, because |
| 663 | ;; `file-attributes' reads the values from there. | 663 | ;; `file-attributes' reads the values from there. |
| 664 | (tramp-flush-file-property v (file-name-directory localname)) | 664 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 665 | (tramp-flush-file-property v localname) | 665 | (tramp-flush-file-properties v localname) |
| 666 | (let* ((curbuf (current-buffer)) | 666 | (let* ((curbuf (current-buffer)) |
| 667 | (tmpfile (tramp-compat-make-temp-file filename))) | 667 | (tmpfile (tramp-compat-make-temp-file filename))) |
| 668 | (when (and append (file-exists-p filename)) | 668 | (when (and append (file-exists-p filename)) |
| @@ -692,15 +692,15 @@ But handle the case, if the \"test\" command is not available." | |||
| 692 | (defun tramp-adb-handle-set-file-modes (filename mode) | 692 | (defun tramp-adb-handle-set-file-modes (filename mode) |
| 693 | "Like `set-file-modes' for Tramp files." | 693 | "Like `set-file-modes' for Tramp files." |
| 694 | (with-parsed-tramp-file-name filename nil | 694 | (with-parsed-tramp-file-name filename nil |
| 695 | (tramp-flush-file-property v (file-name-directory localname)) | 695 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 696 | (tramp-flush-file-property v localname) | 696 | (tramp-flush-file-properties v localname) |
| 697 | (tramp-adb-send-command-and-check v (format "chmod %o %s" mode localname)))) | 697 | (tramp-adb-send-command-and-check v (format "chmod %o %s" mode localname)))) |
| 698 | 698 | ||
| 699 | (defun tramp-adb-handle-set-file-times (filename &optional time) | 699 | (defun tramp-adb-handle-set-file-times (filename &optional time) |
| 700 | "Like `set-file-times' for Tramp files." | 700 | "Like `set-file-times' for Tramp files." |
| 701 | (with-parsed-tramp-file-name filename nil | 701 | (with-parsed-tramp-file-name filename nil |
| 702 | (tramp-flush-file-property v (file-name-directory localname)) | 702 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 703 | (tramp-flush-file-property v localname) | 703 | (tramp-flush-file-properties v localname) |
| 704 | (let ((time (if (or (null time) (equal time '(0 0))) | 704 | (let ((time (if (or (null time) (equal time '(0 0))) |
| 705 | (current-time) | 705 | (current-time) |
| 706 | time))) | 706 | time))) |
| @@ -736,8 +736,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 736 | ;; We must also flush the cache of the directory, | 736 | ;; We must also flush the cache of the directory, |
| 737 | ;; because `file-attributes' reads the values from | 737 | ;; because `file-attributes' reads the values from |
| 738 | ;; there. | 738 | ;; there. |
| 739 | (tramp-flush-file-property v (file-name-directory l2)) | 739 | (tramp-flush-file-properties v (file-name-directory l2)) |
| 740 | (tramp-flush-file-property v l2) | 740 | (tramp-flush-file-properties v l2) |
| 741 | ;; Short track. | 741 | ;; Short track. |
| 742 | (tramp-adb-barf-unless-okay | 742 | (tramp-adb-barf-unless-okay |
| 743 | v (format | 743 | v (format |
| @@ -771,8 +771,9 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 771 | ;; We must also flush the cache of the directory, | 771 | ;; We must also flush the cache of the directory, |
| 772 | ;; because `file-attributes' reads the values from | 772 | ;; because `file-attributes' reads the values from |
| 773 | ;; there. | 773 | ;; there. |
| 774 | (tramp-flush-file-property v (file-name-directory localname)) | 774 | (tramp-flush-file-properties |
| 775 | (tramp-flush-file-property v localname) | 775 | v (file-name-directory localname)) |
| 776 | (tramp-flush-file-properties v localname) | ||
| 776 | (when (tramp-adb-execute-adb-command | 777 | (when (tramp-adb-execute-adb-command |
| 777 | v "push" | 778 | v "push" |
| 778 | (tramp-compat-file-name-unquote filename) | 779 | (tramp-compat-file-name-unquote filename) |
| @@ -815,10 +816,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 815 | (tramp-error v 'file-already-exists newname)) | 816 | (tramp-error v 'file-already-exists newname)) |
| 816 | ;; We must also flush the cache of the directory, because | 817 | ;; We must also flush the cache of the directory, because |
| 817 | ;; `file-attributes' reads the values from there. | 818 | ;; `file-attributes' reads the values from there. |
| 818 | (tramp-flush-file-property v (file-name-directory l1)) | 819 | (tramp-flush-file-properties v (file-name-directory l1)) |
| 819 | (tramp-flush-file-property v l1) | 820 | (tramp-flush-file-properties v l1) |
| 820 | (tramp-flush-file-property v (file-name-directory l2)) | 821 | (tramp-flush-file-properties v (file-name-directory l2)) |
| 821 | (tramp-flush-file-property v l2) | 822 | (tramp-flush-file-properties v l2) |
| 822 | ;; Short track. | 823 | ;; Short track. |
| 823 | (tramp-adb-barf-unless-okay | 824 | (tramp-adb-barf-unless-okay |
| 824 | v (format | 825 | v (format |
| @@ -930,7 +931,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 930 | (when tmpinput (delete-file tmpinput)) | 931 | (when tmpinput (delete-file tmpinput)) |
| 931 | 932 | ||
| 932 | (unless process-file-side-effects | 933 | (unless process-file-side-effects |
| 933 | (tramp-flush-directory-property v "")) | 934 | (tramp-flush-directory-properties v "")) |
| 934 | 935 | ||
| 935 | ;; Return exit status. | 936 | ;; Return exit status. |
| 936 | (if (equal ret -1) | 937 | (if (equal ret -1) |
| @@ -1087,8 +1088,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 1087 | (set-process-buffer (tramp-get-connection-process v) nil) | 1088 | (set-process-buffer (tramp-get-connection-process v) nil) |
| 1088 | (kill-buffer (current-buffer))) | 1089 | (kill-buffer (current-buffer))) |
| 1089 | (set-buffer-modified-p bmp)) | 1090 | (set-buffer-modified-p bmp)) |
| 1090 | (tramp-set-connection-property v "process-name" nil) | 1091 | (tramp-flush-connection-property v "process-name") |
| 1091 | (tramp-set-connection-property v "process-buffer" nil)))))) | 1092 | (tramp-flush-connection-property v "process-buffer")))))) |
| 1092 | 1093 | ||
| 1093 | (defun tramp-adb-get-device (vec) | 1094 | (defun tramp-adb-get-device (vec) |
| 1094 | "Return full host name from VEC to be used in shell execution. | 1095 | "Return full host name from VEC to be used in shell execution. |
| @@ -1097,7 +1098,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\" | |||
| 1097 | ;; Sometimes this is called before there is a connection process | 1098 | ;; Sometimes this is called before there is a connection process |
| 1098 | ;; yet. In order to work with the connection cache, we flush all | 1099 | ;; yet. In order to work with the connection cache, we flush all |
| 1099 | ;; unwanted entries first. | 1100 | ;; unwanted entries first. |
| 1100 | (tramp-flush-connection-property nil) | 1101 | (tramp-flush-connection-properties nil) |
| 1101 | (with-tramp-connection-property (tramp-get-connection-process vec) "device" | 1102 | (with-tramp-connection-property (tramp-get-connection-process vec) "device" |
| 1102 | (let* ((host (tramp-file-name-host vec)) | 1103 | (let* ((host (tramp-file-name-host vec)) |
| 1103 | (port (tramp-file-name-port-or-default vec)) | 1104 | (port (tramp-file-name-port-or-default vec)) |
| @@ -1310,7 +1311,7 @@ connection if a previous connection has died for some reason." | |||
| 1310 | (tramp-adb-send-command vec (format "su %s" user)) | 1311 | (tramp-adb-send-command vec (format "su %s" user)) |
| 1311 | (unless (tramp-adb-send-command-and-check vec nil) | 1312 | (unless (tramp-adb-send-command-and-check vec nil) |
| 1312 | (delete-process p) | 1313 | (delete-process p) |
| 1313 | (tramp-set-file-property vec "" "su-command-p" nil) | 1314 | (tramp-flush-file-property vec "" "su-command-p") |
| 1314 | (tramp-error | 1315 | (tramp-error |
| 1315 | vec 'file-error "Cannot switch to user `%s'" user))) | 1316 | vec 'file-error "Cannot switch to user `%s'" user))) |
| 1316 | 1317 | ||
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index bd746c1a99a..56f3f28c5c3 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el | |||
| @@ -166,7 +166,22 @@ Returns VALUE." | |||
| 166 | value)) | 166 | value)) |
| 167 | 167 | ||
| 168 | ;;;###tramp-autoload | 168 | ;;;###tramp-autoload |
| 169 | (defun tramp-flush-file-property (key file) | 169 | (defun tramp-flush-file-property (key file property) |
| 170 | "Remove PROPERTY of FILE in the cache context of KEY." | ||
| 171 | ;; Unify localname. Remove hop from `tramp-file-name' structure. | ||
| 172 | (setq file (tramp-compat-file-name-unquote file) | ||
| 173 | key (copy-tramp-file-name key)) | ||
| 174 | (setf (tramp-file-name-localname key) | ||
| 175 | (tramp-run-real-handler 'directory-file-name (list file)) | ||
| 176 | (tramp-file-name-hop key) nil) | ||
| 177 | (remhash property (tramp-get-hash-table key)) | ||
| 178 | (tramp-message key 8 "%s %s" file property) | ||
| 179 | (when (>= tramp-verbose 10) | ||
| 180 | (let ((var (intern (concat "tramp-cache-set-count-" property)))) | ||
| 181 | (makunbound var)))) | ||
| 182 | |||
| 183 | ;;;###tramp-autoload | ||
| 184 | (defun tramp-flush-file-properties (key file) | ||
| 170 | "Remove all properties of FILE in the cache context of KEY." | 185 | "Remove all properties of FILE in the cache context of KEY." |
| 171 | (let* ((file (tramp-run-real-handler | 186 | (let* ((file (tramp-run-real-handler |
| 172 | 'directory-file-name (list file))) | 187 | 'directory-file-name (list file))) |
| @@ -181,10 +196,10 @@ Returns VALUE." | |||
| 181 | ;; Remove file properties of symlinks. | 196 | ;; Remove file properties of symlinks. |
| 182 | (when (and (stringp truename) | 197 | (when (and (stringp truename) |
| 183 | (not (string-equal file (directory-file-name truename)))) | 198 | (not (string-equal file (directory-file-name truename)))) |
| 184 | (tramp-flush-file-property key truename)))) | 199 | (tramp-flush-file-properties key truename)))) |
| 185 | 200 | ||
| 186 | ;;;###tramp-autoload | 201 | ;;;###tramp-autoload |
| 187 | (defun tramp-flush-directory-property (key directory) | 202 | (defun tramp-flush-directory-properties (key directory) |
| 188 | "Remove all properties of DIRECTORY in the cache context of KEY. | 203 | "Remove all properties of DIRECTORY in the cache context of KEY. |
| 189 | Remove also properties of all files in subdirectories." | 204 | Remove also properties of all files in subdirectories." |
| 190 | (setq directory (tramp-compat-file-name-unquote directory)) | 205 | (setq directory (tramp-compat-file-name-unquote directory)) |
| @@ -203,7 +218,7 @@ Remove also properties of all files in subdirectories." | |||
| 203 | ;; Remove file properties of symlinks. | 218 | ;; Remove file properties of symlinks. |
| 204 | (when (and (stringp truename) | 219 | (when (and (stringp truename) |
| 205 | (not (string-equal directory (directory-file-name truename)))) | 220 | (not (string-equal directory (directory-file-name truename)))) |
| 206 | (tramp-flush-directory-property key truename)))) | 221 | (tramp-flush-directory-properties key truename)))) |
| 207 | 222 | ||
| 208 | ;; Reverting or killing a buffer should also flush file properties. | 223 | ;; Reverting or killing a buffer should also flush file properties. |
| 209 | ;; They could have been changed outside Tramp. In eshell, "ls" would | 224 | ;; They could have been changed outside Tramp. In eshell, "ls" would |
| @@ -222,7 +237,7 @@ This is suppressed for temporary buffers." | |||
| 222 | (tramp-verbose 0)) | 237 | (tramp-verbose 0)) |
| 223 | (when (tramp-tramp-file-p bfn) | 238 | (when (tramp-tramp-file-p bfn) |
| 224 | (with-parsed-tramp-file-name bfn nil | 239 | (with-parsed-tramp-file-name bfn nil |
| 225 | (tramp-flush-file-property v localname))))))) | 240 | (tramp-flush-file-properties v localname))))))) |
| 226 | 241 | ||
| 227 | (add-hook 'before-revert-hook 'tramp-flush-file-function) | 242 | (add-hook 'before-revert-hook 'tramp-flush-file-function) |
| 228 | (add-hook 'eshell-pre-command-hook 'tramp-flush-file-function) | 243 | (add-hook 'eshell-pre-command-hook 'tramp-flush-file-function) |
| @@ -291,7 +306,24 @@ used to cache connection properties of the local machine." | |||
| 291 | (not (eq (tramp-get-connection-property key property 'undef) 'undef))) | 306 | (not (eq (tramp-get-connection-property key property 'undef) 'undef))) |
| 292 | 307 | ||
| 293 | ;;;###tramp-autoload | 308 | ;;;###tramp-autoload |
| 294 | (defun tramp-flush-connection-property (key) | 309 | (defun tramp-flush-connection-property (key property) |
| 310 | "Remove the named PROPERTY of a connection identified by KEY. | ||
| 311 | KEY identifies the connection, it is either a process or a | ||
| 312 | `tramp-file-name' structure. A special case is nil, which is | ||
| 313 | used to cache connection properties of the local machine. | ||
| 314 | PROPERTY is set persistent when KEY is a `tramp-file-name' structure." | ||
| 315 | ;; Unify key by removing localname and hop from `tramp-file-name' | ||
| 316 | ;; structure. Work with a copy in order to avoid side effects. | ||
| 317 | (when (tramp-file-name-p key) | ||
| 318 | (setq key (copy-tramp-file-name key)) | ||
| 319 | (setf (tramp-file-name-localname key) nil | ||
| 320 | (tramp-file-name-hop key) nil)) | ||
| 321 | (remhash property (tramp-get-hash-table key)) | ||
| 322 | (setq tramp-cache-data-changed t) | ||
| 323 | (tramp-message key 7 "%s" property)) | ||
| 324 | |||
| 325 | ;;;###tramp-autoload | ||
| 326 | (defun tramp-flush-connection-properties (key) | ||
| 295 | "Remove all properties identified by KEY. | 327 | "Remove all properties identified by KEY. |
| 296 | KEY identifies the connection, it is either a process or a | 328 | KEY identifies the connection, it is either a process or a |
| 297 | `tramp-file-name' structure. A special case is nil, which is | 329 | `tramp-file-name' structure. A special case is nil, which is |
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 1f72e255c49..ed36761ed96 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el | |||
| @@ -104,13 +104,13 @@ When called interactively, a Tramp connection has to be selected." | |||
| 104 | (when keep-password (setq tramp-current-connection nil)) | 104 | (when keep-password (setq tramp-current-connection nil)) |
| 105 | 105 | ||
| 106 | ;; Flush file cache. | 106 | ;; Flush file cache. |
| 107 | (tramp-flush-directory-property vec "") | 107 | (tramp-flush-directory-properties vec "") |
| 108 | 108 | ||
| 109 | ;; Flush connection cache. | 109 | ;; Flush connection cache. |
| 110 | (when (processp (tramp-get-connection-process vec)) | 110 | (when (processp (tramp-get-connection-process vec)) |
| 111 | (tramp-flush-connection-property (tramp-get-connection-process vec)) | 111 | (tramp-flush-connection-properties (tramp-get-connection-process vec)) |
| 112 | (delete-process (tramp-get-connection-process vec))) | 112 | (delete-process (tramp-get-connection-process vec))) |
| 113 | (tramp-flush-connection-property vec) | 113 | (tramp-flush-connection-properties vec) |
| 114 | 114 | ||
| 115 | ;; Remove buffers. | 115 | ;; Remove buffers. |
| 116 | (dolist | 116 | (dolist |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index a1d50b6f2e8..a65b8e96d53 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -745,13 +745,13 @@ file names." | |||
| 745 | 745 | ||
| 746 | (when (and t1 (eq op 'rename)) | 746 | (when (and t1 (eq op 'rename)) |
| 747 | (with-parsed-tramp-file-name filename nil | 747 | (with-parsed-tramp-file-name filename nil |
| 748 | (tramp-flush-file-property v (file-name-directory localname)) | 748 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 749 | (tramp-flush-file-property v localname))) | 749 | (tramp-flush-file-properties v localname))) |
| 750 | 750 | ||
| 751 | (when t2 | 751 | (when t2 |
| 752 | (with-parsed-tramp-file-name newname nil | 752 | (with-parsed-tramp-file-name newname nil |
| 753 | (tramp-flush-file-property v (file-name-directory localname)) | 753 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 754 | (tramp-flush-file-property v localname)))))))) | 754 | (tramp-flush-file-properties v localname)))))))) |
| 755 | 755 | ||
| 756 | (defun tramp-gvfs-handle-copy-file | 756 | (defun tramp-gvfs-handle-copy-file |
| 757 | (filename newname &optional ok-if-already-exists keep-date | 757 | (filename newname &optional ok-if-already-exists keep-date |
| @@ -785,8 +785,8 @@ file names." | |||
| 785 | (tramp-error | 785 | (tramp-error |
| 786 | v 'file-error "Couldn't delete non-empty %s" directory))) | 786 | v 'file-error "Couldn't delete non-empty %s" directory))) |
| 787 | 787 | ||
| 788 | (tramp-flush-file-property v (file-name-directory localname)) | 788 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 789 | (tramp-flush-directory-property v localname) | 789 | (tramp-flush-directory-properties v localname) |
| 790 | (unless | 790 | (unless |
| 791 | (tramp-gvfs-send-command | 791 | (tramp-gvfs-send-command |
| 792 | v (if (and trash delete-by-moving-to-trash) "gvfs-trash" "gvfs-rm") | 792 | v (if (and trash delete-by-moving-to-trash) "gvfs-trash" "gvfs-rm") |
| @@ -800,8 +800,8 @@ file names." | |||
| 800 | (defun tramp-gvfs-handle-delete-file (filename &optional trash) | 800 | (defun tramp-gvfs-handle-delete-file (filename &optional trash) |
| 801 | "Like `delete-file' for Tramp files." | 801 | "Like `delete-file' for Tramp files." |
| 802 | (with-parsed-tramp-file-name filename nil | 802 | (with-parsed-tramp-file-name filename nil |
| 803 | (tramp-flush-file-property v (file-name-directory localname)) | 803 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 804 | (tramp-flush-file-property v localname) | 804 | (tramp-flush-file-properties v localname) |
| 805 | (unless | 805 | (unless |
| 806 | (tramp-gvfs-send-command | 806 | (tramp-gvfs-send-command |
| 807 | v (if (and trash delete-by-moving-to-trash) "gvfs-trash" "gvfs-rm") | 807 | v (if (and trash delete-by-moving-to-trash) "gvfs-trash" "gvfs-rm") |
| @@ -1180,7 +1180,7 @@ file-notify events." | |||
| 1180 | (setq filename (directory-file-name (expand-file-name filename))) | 1180 | (setq filename (directory-file-name (expand-file-name filename))) |
| 1181 | (with-parsed-tramp-file-name filename nil | 1181 | (with-parsed-tramp-file-name filename nil |
| 1182 | ;; We don't use cached values. | 1182 | ;; We don't use cached values. |
| 1183 | (tramp-set-file-property v localname "file-system-attributes" 'undef) | 1183 | (tramp-flush-file-property v localname "file-system-attributes") |
| 1184 | (let* ((attr (tramp-gvfs-get-root-attributes filename 'file-system)) | 1184 | (let* ((attr (tramp-gvfs-get-root-attributes filename 'file-system)) |
| 1185 | (size (cdr (assoc "filesystem::size" attr))) | 1185 | (size (cdr (assoc "filesystem::size" attr))) |
| 1186 | (used (cdr (assoc "filesystem::used" attr))) | 1186 | (used (cdr (assoc "filesystem::used" attr))) |
| @@ -1205,8 +1205,8 @@ file-notify events." | |||
| 1205 | "Like `make-directory' for Tramp files." | 1205 | "Like `make-directory' for Tramp files." |
| 1206 | (setq dir (directory-file-name (expand-file-name dir))) | 1206 | (setq dir (directory-file-name (expand-file-name dir))) |
| 1207 | (with-parsed-tramp-file-name dir nil | 1207 | (with-parsed-tramp-file-name dir nil |
| 1208 | (tramp-flush-file-property v (file-name-directory localname)) | 1208 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 1209 | (tramp-flush-directory-property v localname) | 1209 | (tramp-flush-directory-properties v localname) |
| 1210 | (save-match-data | 1210 | (save-match-data |
| 1211 | (let ((ldir (file-name-directory dir))) | 1211 | (let ((ldir (file-name-directory dir))) |
| 1212 | ;; Make missing directory parts. "gvfs-mkdir -p ..." does not | 1212 | ;; Make missing directory parts. "gvfs-mkdir -p ..." does not |
| @@ -1262,8 +1262,8 @@ file-notify events." | |||
| 1262 | (tramp-error | 1262 | (tramp-error |
| 1263 | v 'file-error "Couldn't write region to `%s'" filename)))) | 1263 | v 'file-error "Couldn't write region to `%s'" filename)))) |
| 1264 | 1264 | ||
| 1265 | (tramp-flush-file-property v (file-name-directory localname)) | 1265 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 1266 | (tramp-flush-file-property v localname) | 1266 | (tramp-flush-file-properties v localname) |
| 1267 | 1267 | ||
| 1268 | ;; Set file modification time. | 1268 | ;; Set file modification time. |
| 1269 | (when (or (eq visit t) (stringp visit)) | 1269 | (when (or (eq visit t) (stringp visit)) |
| @@ -1487,9 +1487,9 @@ ADDRESS can have the form \"xx:xx:xx:xx:xx:xx\" or \"[xx:xx:xx:xx:xx:xx]\"." | |||
| 1487 | (tramp-message | 1487 | (tramp-message |
| 1488 | v 6 "%s %s" | 1488 | v 6 "%s %s" |
| 1489 | signal-name (tramp-gvfs-stringify-dbus-message mount-info)) | 1489 | signal-name (tramp-gvfs-stringify-dbus-message mount-info)) |
| 1490 | (tramp-set-file-property v "/" "list-mounts" 'undef) | 1490 | (tramp-flush-file-property v "/" "list-mounts") |
| 1491 | (if (string-equal (downcase signal-name) "unmounted") | 1491 | (if (string-equal (downcase signal-name) "unmounted") |
| 1492 | (tramp-flush-file-property v "/") | 1492 | (tramp-flush-file-properties v "/") |
| 1493 | ;; Set prefix, mountpoint and location. | 1493 | ;; Set prefix, mountpoint and location. |
| 1494 | (unless (string-equal prefix "/") | 1494 | (unless (string-equal prefix "/") |
| 1495 | (tramp-set-file-property v "/" "prefix" prefix)) | 1495 | (tramp-set-file-property v "/" "prefix" prefix)) |
| @@ -1865,7 +1865,7 @@ is applied, and it returns t if the return code is zero." | |||
| 1865 | (erase-buffer) | 1865 | (erase-buffer) |
| 1866 | (or (zerop (apply 'tramp-call-process vec command nil t nil args)) | 1866 | (or (zerop (apply 'tramp-call-process vec command nil t nil args)) |
| 1867 | ;; Remove information about mounted connection. | 1867 | ;; Remove information about mounted connection. |
| 1868 | (and (tramp-flush-file-property vec "/") nil))))) | 1868 | (and (tramp-flush-file-properties vec "/") nil))))) |
| 1869 | 1869 | ||
| 1870 | 1870 | ||
| 1871 | ;; D-Bus BLUEZ functions. | 1871 | ;; D-Bus BLUEZ functions. |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 1ca19e05f20..361e4c3e300 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -1104,8 +1104,8 @@ component is used as the target of the symlink." | |||
| 1104 | (tramp-error v 'file-already-exists localname) | 1104 | (tramp-error v 'file-already-exists localname) |
| 1105 | (delete-file linkname))) | 1105 | (delete-file linkname))) |
| 1106 | 1106 | ||
| 1107 | (tramp-flush-file-property v (file-name-directory localname)) | 1107 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 1108 | (tramp-flush-file-property v localname) | 1108 | (tramp-flush-file-properties v localname) |
| 1109 | 1109 | ||
| 1110 | ;; Right, they are on the same host, regardless of user, | 1110 | ;; Right, they are on the same host, regardless of user, |
| 1111 | ;; method, etc. We now make the link on the remote | 1111 | ;; method, etc. We now make the link on the remote |
| @@ -1500,8 +1500,8 @@ of." | |||
| 1500 | (defun tramp-sh-handle-set-file-modes (filename mode) | 1500 | (defun tramp-sh-handle-set-file-modes (filename mode) |
| 1501 | "Like `set-file-modes' for Tramp files." | 1501 | "Like `set-file-modes' for Tramp files." |
| 1502 | (with-parsed-tramp-file-name filename nil | 1502 | (with-parsed-tramp-file-name filename nil |
| 1503 | (tramp-flush-file-property v (file-name-directory localname)) | 1503 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 1504 | (tramp-flush-file-property v localname) | 1504 | (tramp-flush-file-properties v localname) |
| 1505 | ;; FIXME: extract the proper text from chmod's stderr. | 1505 | ;; FIXME: extract the proper text from chmod's stderr. |
| 1506 | (tramp-barf-unless-okay | 1506 | (tramp-barf-unless-okay |
| 1507 | v | 1507 | v |
| @@ -1512,8 +1512,8 @@ of." | |||
| 1512 | "Like `set-file-times' for Tramp files." | 1512 | "Like `set-file-times' for Tramp files." |
| 1513 | (with-parsed-tramp-file-name filename nil | 1513 | (with-parsed-tramp-file-name filename nil |
| 1514 | (when (tramp-get-remote-touch v) | 1514 | (when (tramp-get-remote-touch v) |
| 1515 | (tramp-flush-file-property v (file-name-directory localname)) | 1515 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 1516 | (tramp-flush-file-property v localname) | 1516 | (tramp-flush-file-properties v localname) |
| 1517 | (let ((time (if (or (null time) (equal time '(0 0))) | 1517 | (let ((time (if (or (null time) (equal time '(0 0))) |
| 1518 | (current-time) | 1518 | (current-time) |
| 1519 | time))) | 1519 | time))) |
| @@ -1605,8 +1605,7 @@ be non-negative integers." | |||
| 1605 | (if (and user role type range) | 1605 | (if (and user role type range) |
| 1606 | (tramp-set-file-property | 1606 | (tramp-set-file-property |
| 1607 | v localname "file-selinux-context" context) | 1607 | v localname "file-selinux-context" context) |
| 1608 | (tramp-set-file-property | 1608 | (tramp-flush-file-property v localname "file-selinux-context")) |
| 1609 | v localname "file-selinux-context" 'undef)) | ||
| 1610 | t))))) | 1609 | t))))) |
| 1611 | 1610 | ||
| 1612 | (defun tramp-remote-acl-p (vec) | 1611 | (defun tramp-remote-acl-p (vec) |
| @@ -1646,7 +1645,7 @@ be non-negative integers." | |||
| 1646 | (tramp-set-file-property v localname "file-acl" acl-string) | 1645 | (tramp-set-file-property v localname "file-acl" acl-string) |
| 1647 | t) | 1646 | t) |
| 1648 | ;; In case of errors, we return nil. | 1647 | ;; In case of errors, we return nil. |
| 1649 | (tramp-set-file-property v localname "file-acl-string" 'undef) | 1648 | (tramp-flush-file-property v localname "file-acl-string") |
| 1650 | nil))) | 1649 | nil))) |
| 1651 | 1650 | ||
| 1652 | ;; Simple functions using the `test' command. | 1651 | ;; Simple functions using the `test' command. |
| @@ -1940,8 +1939,8 @@ tramp-sh-handle-file-name-all-completions: internal error accessing `%s': `%s'" | |||
| 1940 | v2-localname))))) | 1939 | v2-localname))))) |
| 1941 | (tramp-error v2 'file-already-exists newname) | 1940 | (tramp-error v2 'file-already-exists newname) |
| 1942 | (delete-file newname))) | 1941 | (delete-file newname))) |
| 1943 | (tramp-flush-file-property v2 (file-name-directory v2-localname)) | 1942 | (tramp-flush-file-properties v2 (file-name-directory v2-localname)) |
| 1944 | (tramp-flush-file-property v2 v2-localname) | 1943 | (tramp-flush-file-properties v2 v2-localname) |
| 1945 | (tramp-barf-unless-okay | 1944 | (tramp-barf-unless-okay |
| 1946 | v1 | 1945 | v1 |
| 1947 | (format "%s %s %s" ln | 1946 | (format "%s %s %s" ln |
| @@ -2007,8 +2006,8 @@ tramp-sh-handle-file-name-all-completions: internal error accessing `%s': `%s'" | |||
| 2007 | ;; When newname did exist, we have wrong cached values. | 2006 | ;; When newname did exist, we have wrong cached values. |
| 2008 | (when t2 | 2007 | (when t2 |
| 2009 | (with-parsed-tramp-file-name newname nil | 2008 | (with-parsed-tramp-file-name newname nil |
| 2010 | (tramp-flush-file-property v (file-name-directory localname)) | 2009 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 2011 | (tramp-flush-file-property v localname)))))) | 2010 | (tramp-flush-file-properties v localname)))))) |
| 2012 | 2011 | ||
| 2013 | (defun tramp-sh-handle-rename-file | 2012 | (defun tramp-sh-handle-rename-file |
| 2014 | (filename newname &optional ok-if-already-exists) | 2013 | (filename newname &optional ok-if-already-exists) |
| @@ -2133,14 +2132,16 @@ file names." | |||
| 2133 | ;; In case of `rename', we must flush the cache of the source file. | 2132 | ;; In case of `rename', we must flush the cache of the source file. |
| 2134 | (when (and t1 (eq op 'rename)) | 2133 | (when (and t1 (eq op 'rename)) |
| 2135 | (with-parsed-tramp-file-name filename v1 | 2134 | (with-parsed-tramp-file-name filename v1 |
| 2136 | (tramp-flush-file-property v1 (file-name-directory v1-localname)) | 2135 | (tramp-flush-file-properties |
| 2137 | (tramp-flush-file-property v1 v1-localname))) | 2136 | v1 (file-name-directory v1-localname)) |
| 2137 | (tramp-flush-file-properties v1 v1-localname))) | ||
| 2138 | 2138 | ||
| 2139 | ;; When newname did exist, we have wrong cached values. | 2139 | ;; When newname did exist, we have wrong cached values. |
| 2140 | (when t2 | 2140 | (when t2 |
| 2141 | (with-parsed-tramp-file-name newname v2 | 2141 | (with-parsed-tramp-file-name newname v2 |
| 2142 | (tramp-flush-file-property v2 (file-name-directory v2-localname)) | 2142 | (tramp-flush-file-properties |
| 2143 | (tramp-flush-file-property v2 v2-localname)))))))) | 2143 | v2 (file-name-directory v2-localname)) |
| 2144 | (tramp-flush-file-properties v2 v2-localname)))))))) | ||
| 2144 | 2145 | ||
| 2145 | (defun tramp-do-copy-or-rename-file-via-buffer (op filename newname keep-date) | 2146 | (defun tramp-do-copy-or-rename-file-via-buffer (op filename newname keep-date) |
| 2146 | "Use an Emacs buffer to copy or rename a file. | 2147 | "Use an Emacs buffer to copy or rename a file. |
| @@ -2515,8 +2516,8 @@ The method used must be an out-of-band method." | |||
| 2515 | p v nil tramp-actions-copy-out-of-band)))) | 2516 | p v nil tramp-actions-copy-out-of-band)))) |
| 2516 | 2517 | ||
| 2517 | ;; Reset the transfer process properties. | 2518 | ;; Reset the transfer process properties. |
| 2518 | (tramp-set-connection-property v "process-name" nil) | 2519 | (tramp-flush-connection-property v "process-name") |
| 2519 | (tramp-set-connection-property v "process-buffer" nil) | 2520 | (tramp-flush-connection-property v "process-buffer") |
| 2520 | ;; Clear the remote prompt. | 2521 | ;; Clear the remote prompt. |
| 2521 | (when (and remote-copy-program | 2522 | (when (and remote-copy-program |
| 2522 | (not (tramp-send-command-and-check v nil))) | 2523 | (not (tramp-send-command-and-check v nil))) |
| @@ -2547,7 +2548,7 @@ The method used must be an out-of-band method." | |||
| 2547 | "Like `make-directory' for Tramp files." | 2548 | "Like `make-directory' for Tramp files." |
| 2548 | (setq dir (expand-file-name dir)) | 2549 | (setq dir (expand-file-name dir)) |
| 2549 | (with-parsed-tramp-file-name dir nil | 2550 | (with-parsed-tramp-file-name dir nil |
| 2550 | (tramp-flush-directory-property v (file-name-directory localname)) | 2551 | (tramp-flush-directory-properties v (file-name-directory localname)) |
| 2551 | (save-excursion | 2552 | (save-excursion |
| 2552 | (tramp-barf-unless-okay | 2553 | (tramp-barf-unless-okay |
| 2553 | v (format "%s %s" | 2554 | v (format "%s %s" |
| @@ -2559,8 +2560,8 @@ The method used must be an out-of-band method." | |||
| 2559 | "Like `delete-directory' for Tramp files." | 2560 | "Like `delete-directory' for Tramp files." |
| 2560 | (setq directory (expand-file-name directory)) | 2561 | (setq directory (expand-file-name directory)) |
| 2561 | (with-parsed-tramp-file-name directory nil | 2562 | (with-parsed-tramp-file-name directory nil |
| 2562 | (tramp-flush-file-property v (file-name-directory localname)) | 2563 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 2563 | (tramp-flush-directory-property v localname) | 2564 | (tramp-flush-directory-properties v localname) |
| 2564 | (tramp-barf-unless-okay | 2565 | (tramp-barf-unless-okay |
| 2565 | v (format "cd / && %s %s" | 2566 | v (format "cd / && %s %s" |
| 2566 | (or (and trash (tramp-get-remote-trash v)) | 2567 | (or (and trash (tramp-get-remote-trash v)) |
| @@ -2572,8 +2573,8 @@ The method used must be an out-of-band method." | |||
| 2572 | "Like `delete-file' for Tramp files." | 2573 | "Like `delete-file' for Tramp files." |
| 2573 | (setq filename (expand-file-name filename)) | 2574 | (setq filename (expand-file-name filename)) |
| 2574 | (with-parsed-tramp-file-name filename nil | 2575 | (with-parsed-tramp-file-name filename nil |
| 2575 | (tramp-flush-file-property v (file-name-directory localname)) | 2576 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 2576 | (tramp-flush-file-property v localname) | 2577 | (tramp-flush-file-properties v localname) |
| 2577 | (tramp-barf-unless-okay | 2578 | (tramp-barf-unless-okay |
| 2578 | v (format "%s %s" | 2579 | v (format "%s %s" |
| 2579 | (or (and trash (tramp-get-remote-trash v)) "rm -f") | 2580 | (or (and trash (tramp-get-remote-trash v)) "rm -f") |
| @@ -2586,7 +2587,7 @@ The method used must be an out-of-band method." | |||
| 2586 | "Like `dired-compress-file' for Tramp files." | 2587 | "Like `dired-compress-file' for Tramp files." |
| 2587 | ;; Code stolen mainly from dired-aux.el. | 2588 | ;; Code stolen mainly from dired-aux.el. |
| 2588 | (with-parsed-tramp-file-name file nil | 2589 | (with-parsed-tramp-file-name file nil |
| 2589 | (tramp-flush-file-property v localname) | 2590 | (tramp-flush-file-properties v localname) |
| 2590 | (save-excursion | 2591 | (save-excursion |
| 2591 | (let ((suffixes dired-compress-file-suffixes) | 2592 | (let ((suffixes dired-compress-file-suffixes) |
| 2592 | suffix) | 2593 | suffix) |
| @@ -2822,8 +2823,8 @@ the result will be a local, non-Tramp, file name." | |||
| 2822 | (let ((vec (tramp-get-connection-property proc "vector" nil))) | 2823 | (let ((vec (tramp-get-connection-property proc "vector" nil))) |
| 2823 | (when vec | 2824 | (when vec |
| 2824 | (tramp-message vec 5 "Sentinel called: `%S' `%s'" proc event) | 2825 | (tramp-message vec 5 "Sentinel called: `%S' `%s'" proc event) |
| 2825 | (tramp-flush-connection-property proc) | 2826 | (tramp-flush-connection-properties proc) |
| 2826 | (tramp-flush-directory-property vec ""))))) | 2827 | (tramp-flush-directory-properties vec ""))))) |
| 2827 | 2828 | ||
| 2828 | ;; We use BUFFER also as connection buffer during setup. Because of | 2829 | ;; We use BUFFER also as connection buffer during setup. Because of |
| 2829 | ;; this, its original contents must be saved, and restored once | 2830 | ;; this, its original contents must be saved, and restored once |
| @@ -2957,8 +2958,8 @@ the result will be a local, non-Tramp, file name." | |||
| 2957 | (set-process-buffer p nil) | 2958 | (set-process-buffer p nil) |
| 2958 | (kill-buffer (current-buffer))) | 2959 | (kill-buffer (current-buffer))) |
| 2959 | (set-buffer-modified-p bmp)) | 2960 | (set-buffer-modified-p bmp)) |
| 2960 | (tramp-set-connection-property v "process-name" nil) | 2961 | (tramp-flush-connection-property v "process-name") |
| 2961 | (tramp-set-connection-property v "process-buffer" nil)))))) | 2962 | (tramp-flush-connection-property v "process-buffer")))))) |
| 2962 | 2963 | ||
| 2963 | (defun tramp-sh-handle-process-file | 2964 | (defun tramp-sh-handle-process-file |
| 2964 | (program &optional infile destination display &rest args) | 2965 | (program &optional infile destination display &rest args) |
| @@ -3080,7 +3081,7 @@ the result will be a local, non-Tramp, file name." | |||
| 3080 | (when tmpinput (delete-file tmpinput)) | 3081 | (when tmpinput (delete-file tmpinput)) |
| 3081 | 3082 | ||
| 3082 | (unless process-file-side-effects | 3083 | (unless process-file-side-effects |
| 3083 | (tramp-flush-directory-property v "")) | 3084 | (tramp-flush-directory-properties v "")) |
| 3084 | 3085 | ||
| 3085 | ;; Return exit status. | 3086 | ;; Return exit status. |
| 3086 | (if (equal ret -1) | 3087 | (if (equal ret -1) |
| @@ -3384,8 +3385,8 @@ the result will be a local, non-Tramp, file name." | |||
| 3384 | (when coding-system-used | 3385 | (when coding-system-used |
| 3385 | (set 'last-coding-system-used coding-system-used)))) | 3386 | (set 'last-coding-system-used coding-system-used)))) |
| 3386 | 3387 | ||
| 3387 | (tramp-flush-file-property v (file-name-directory localname)) | 3388 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 3388 | (tramp-flush-file-property v localname) | 3389 | (tramp-flush-file-properties v localname) |
| 3389 | 3390 | ||
| 3390 | ;; We must protect `last-coding-system-used', now we have set it | 3391 | ;; We must protect `last-coding-system-used', now we have set it |
| 3391 | ;; to its correct value. | 3392 | ;; to its correct value. |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 5a8299b1da1..ec689aea15f 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -370,8 +370,8 @@ pass to the OPERATION." | |||
| 370 | (delete-file newname))) | 370 | (delete-file newname))) |
| 371 | ;; We must also flush the cache of the directory, because | 371 | ;; We must also flush the cache of the directory, because |
| 372 | ;; `file-attributes' reads the values from there. | 372 | ;; `file-attributes' reads the values from there. |
| 373 | (tramp-flush-file-property v2 (file-name-directory v2-localname)) | 373 | (tramp-flush-file-properties v2 (file-name-directory v2-localname)) |
| 374 | (tramp-flush-file-property v2 v2-localname) | 374 | (tramp-flush-file-properties v2 v2-localname) |
| 375 | (unless | 375 | (unless |
| 376 | (tramp-smb-send-command | 376 | (tramp-smb-send-command |
| 377 | v1 | 377 | v1 |
| @@ -527,8 +527,8 @@ pass to the OPERATION." | |||
| 527 | (tramp-message v 6 "\n%s" (buffer-string)))) | 527 | (tramp-message v 6 "\n%s" (buffer-string)))) |
| 528 | 528 | ||
| 529 | ;; Reset the transfer process properties. | 529 | ;; Reset the transfer process properties. |
| 530 | (tramp-set-connection-property v "process-name" nil) | 530 | (tramp-flush-connection-property v "process-name") |
| 531 | (tramp-set-connection-property v "process-buffer" nil) | 531 | (tramp-flush-connection-property v "process-buffer") |
| 532 | (when t1 (delete-directory tmpdir 'recursive)))) | 532 | (when t1 (delete-directory tmpdir 'recursive)))) |
| 533 | 533 | ||
| 534 | ;; Handle KEEP-DATE argument. | 534 | ;; Handle KEEP-DATE argument. |
| @@ -545,8 +545,8 @@ pass to the OPERATION." | |||
| 545 | ;; When newname did exist, we have wrong cached values. | 545 | ;; When newname did exist, we have wrong cached values. |
| 546 | (when t2 | 546 | (when t2 |
| 547 | (with-parsed-tramp-file-name newname nil | 547 | (with-parsed-tramp-file-name newname nil |
| 548 | (tramp-flush-file-property v (file-name-directory localname)) | 548 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 549 | (tramp-flush-file-property v localname)))) | 549 | (tramp-flush-file-properties v localname)))) |
| 550 | 550 | ||
| 551 | ;; We must do it file-wise. | 551 | ;; We must do it file-wise. |
| 552 | (t | 552 | (t |
| @@ -591,8 +591,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 591 | 591 | ||
| 592 | ;; We must also flush the cache of the directory, because | 592 | ;; We must also flush the cache of the directory, because |
| 593 | ;; `file-attributes' reads the values from there. | 593 | ;; `file-attributes' reads the values from there. |
| 594 | (tramp-flush-file-property v (file-name-directory localname)) | 594 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 595 | (tramp-flush-file-property v localname) | 595 | (tramp-flush-file-properties v localname) |
| 596 | (unless (tramp-smb-get-share v) | 596 | (unless (tramp-smb-get-share v) |
| 597 | (tramp-error | 597 | (tramp-error |
| 598 | v 'file-error "Target `%s' must contain a share name" newname)) | 598 | v 'file-error "Target `%s' must contain a share name" newname)) |
| @@ -626,8 +626,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 626 | (with-parsed-tramp-file-name directory nil | 626 | (with-parsed-tramp-file-name directory nil |
| 627 | ;; We must also flush the cache of the directory, because | 627 | ;; We must also flush the cache of the directory, because |
| 628 | ;; `file-attributes' reads the values from there. | 628 | ;; `file-attributes' reads the values from there. |
| 629 | (tramp-flush-file-property v (file-name-directory localname)) | 629 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 630 | (tramp-flush-directory-property v localname) | 630 | (tramp-flush-directory-properties v localname) |
| 631 | (unless (tramp-smb-send-command | 631 | (unless (tramp-smb-send-command |
| 632 | v (format | 632 | v (format |
| 633 | "%s \"%s\"" | 633 | "%s \"%s\"" |
| @@ -647,8 +647,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 647 | (with-parsed-tramp-file-name filename nil | 647 | (with-parsed-tramp-file-name filename nil |
| 648 | ;; We must also flush the cache of the directory, because | 648 | ;; We must also flush the cache of the directory, because |
| 649 | ;; `file-attributes' reads the values from there. | 649 | ;; `file-attributes' reads the values from there. |
| 650 | (tramp-flush-file-property v (file-name-directory localname)) | 650 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 651 | (tramp-flush-file-property v localname) | 651 | (tramp-flush-file-properties v localname) |
| 652 | (unless (tramp-smb-send-command | 652 | (unless (tramp-smb-send-command |
| 653 | v (format | 653 | v (format |
| 654 | "%s \"%s\"" | 654 | "%s \"%s\"" |
| @@ -780,8 +780,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 780 | (substring-no-properties (buffer-string))))) | 780 | (substring-no-properties (buffer-string))))) |
| 781 | 781 | ||
| 782 | ;; Reset the transfer process properties. | 782 | ;; Reset the transfer process properties. |
| 783 | (tramp-set-connection-property v "process-name" nil) | 783 | (tramp-flush-connection-property v "process-name") |
| 784 | (tramp-set-connection-property v "process-buffer" nil)))))))) | 784 | (tramp-flush-connection-property v "process-buffer")))))))) |
| 785 | 785 | ||
| 786 | (defun tramp-smb-handle-file-attributes (filename &optional id-format) | 786 | (defun tramp-smb-handle-file-attributes (filename &optional id-format) |
| 787 | "Like `file-attributes' for Tramp files." | 787 | "Like `file-attributes' for Tramp files." |
| @@ -1144,8 +1144,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 1144 | (format "mkdir \"%s\"" file))) | 1144 | (format "mkdir \"%s\"" file))) |
| 1145 | ;; We must also flush the cache of the directory, because | 1145 | ;; We must also flush the cache of the directory, because |
| 1146 | ;; `file-attributes' reads the values from there. | 1146 | ;; `file-attributes' reads the values from there. |
| 1147 | (tramp-flush-file-property v (file-name-directory localname)) | 1147 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 1148 | (tramp-flush-file-property v localname)) | 1148 | (tramp-flush-file-properties v localname)) |
| 1149 | (unless (file-directory-p directory) | 1149 | (unless (file-directory-p directory) |
| 1150 | (tramp-error | 1150 | (tramp-error |
| 1151 | v 'file-error "Couldn't make directory %s" directory)))))) | 1151 | v 'file-error "Couldn't make directory %s" directory)))))) |
| @@ -1191,8 +1191,8 @@ component is used as the target of the symlink." | |||
| 1191 | 1191 | ||
| 1192 | ;; We must also flush the cache of the directory, because | 1192 | ;; We must also flush the cache of the directory, because |
| 1193 | ;; `file-attributes' reads the values from there. | 1193 | ;; `file-attributes' reads the values from there. |
| 1194 | (tramp-flush-file-property v (file-name-directory localname)) | 1194 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 1195 | (tramp-flush-file-property v localname) | 1195 | (tramp-flush-file-properties v localname) |
| 1196 | 1196 | ||
| 1197 | (unless | 1197 | (unless |
| 1198 | (tramp-smb-send-command | 1198 | (tramp-smb-send-command |
| @@ -1307,14 +1307,14 @@ component is used as the target of the symlink." | |||
| 1307 | 1307 | ||
| 1308 | ;; Cleanup. We remove all file cache values for the connection, | 1308 | ;; Cleanup. We remove all file cache values for the connection, |
| 1309 | ;; because the remote process could have changed them. | 1309 | ;; because the remote process could have changed them. |
| 1310 | (tramp-set-connection-property v "process-name" nil) | 1310 | (tramp-flush-connection-property v "process-name") |
| 1311 | (tramp-set-connection-property v "process-buffer" nil) | 1311 | (tramp-flush-connection-property v "process-buffer") |
| 1312 | (when tmpinput (delete-file tmpinput)) | 1312 | (when tmpinput (delete-file tmpinput)) |
| 1313 | (unless outbuf | 1313 | (unless outbuf |
| 1314 | (kill-buffer (tramp-get-connection-property v "process-buffer" nil))) | 1314 | (kill-buffer (tramp-get-connection-property v "process-buffer" nil))) |
| 1315 | 1315 | ||
| 1316 | (unless process-file-side-effects | 1316 | (unless process-file-side-effects |
| 1317 | (tramp-flush-directory-property v "")) | 1317 | (tramp-flush-directory-properties v "")) |
| 1318 | 1318 | ||
| 1319 | ;; Return exit status. | 1319 | ;; Return exit status. |
| 1320 | (if (equal ret -1) | 1320 | (if (equal ret -1) |
| @@ -1350,10 +1350,10 @@ component is used as the target of the symlink." | |||
| 1350 | 1350 | ||
| 1351 | ;; We must also flush the cache of the directory, because | 1351 | ;; We must also flush the cache of the directory, because |
| 1352 | ;; `file-attributes' reads the values from there. | 1352 | ;; `file-attributes' reads the values from there. |
| 1353 | (tramp-flush-file-property v1 (file-name-directory v1-localname)) | 1353 | (tramp-flush-file-properties v1 (file-name-directory v1-localname)) |
| 1354 | (tramp-flush-file-property v1 v1-localname) | 1354 | (tramp-flush-file-properties v1 v1-localname) |
| 1355 | (tramp-flush-file-property v2 (file-name-directory v2-localname)) | 1355 | (tramp-flush-file-properties v2 (file-name-directory v2-localname)) |
| 1356 | (tramp-flush-file-property v2 v2-localname) | 1356 | (tramp-flush-file-properties v2 v2-localname) |
| 1357 | (unless (tramp-smb-get-share v2) | 1357 | (unless (tramp-smb-get-share v2) |
| 1358 | (tramp-error | 1358 | (tramp-error |
| 1359 | v2 'file-error "Target `%s' must contain a share name" newname)) | 1359 | v2 'file-error "Target `%s' must contain a share name" newname)) |
| @@ -1383,7 +1383,7 @@ component is used as the target of the symlink." | |||
| 1383 | "Like `set-file-acl' for Tramp files." | 1383 | "Like `set-file-acl' for Tramp files." |
| 1384 | (ignore-errors | 1384 | (ignore-errors |
| 1385 | (with-parsed-tramp-file-name filename nil | 1385 | (with-parsed-tramp-file-name filename nil |
| 1386 | (tramp-set-file-property v localname "file-acl" 'undef) | 1386 | (tramp-flush-file-property v localname "file-acl") |
| 1387 | 1387 | ||
| 1388 | (when (and (stringp acl-string) (executable-find tramp-smb-acl-program)) | 1388 | (when (and (stringp acl-string) (executable-find tramp-smb-acl-program)) |
| 1389 | (let* ((share (tramp-smb-get-share v)) | 1389 | (let* ((share (tramp-smb-get-share v)) |
| @@ -1444,14 +1444,14 @@ component is used as the target of the symlink." | |||
| 1444 | t))) | 1444 | t))) |
| 1445 | 1445 | ||
| 1446 | ;; Reset the transfer process properties. | 1446 | ;; Reset the transfer process properties. |
| 1447 | (tramp-set-connection-property v "process-name" nil) | 1447 | (tramp-flush-connection-property v "process-name") |
| 1448 | (tramp-set-connection-property v "process-buffer" nil))))))) | 1448 | (tramp-flush-connection-property v "process-buffer"))))))) |
| 1449 | 1449 | ||
| 1450 | (defun tramp-smb-handle-set-file-modes (filename mode) | 1450 | (defun tramp-smb-handle-set-file-modes (filename mode) |
| 1451 | "Like `set-file-modes' for Tramp files." | 1451 | "Like `set-file-modes' for Tramp files." |
| 1452 | (with-parsed-tramp-file-name filename nil | 1452 | (with-parsed-tramp-file-name filename nil |
| 1453 | (when (tramp-smb-get-cifs-capabilities v) | 1453 | (when (tramp-smb-get-cifs-capabilities v) |
| 1454 | (tramp-flush-file-property v localname) | 1454 | (tramp-flush-file-properties v localname) |
| 1455 | (unless (tramp-smb-send-command | 1455 | (unless (tramp-smb-send-command |
| 1456 | v (format "chmod \"%s\" %o" (tramp-smb-get-localname v) mode)) | 1456 | v (format "chmod \"%s\" %o" (tramp-smb-get-localname v) mode)) |
| 1457 | (tramp-error | 1457 | (tramp-error |
| @@ -1504,8 +1504,8 @@ component is used as the target of the symlink." | |||
| 1504 | (set-process-buffer (tramp-get-connection-process v) nil) | 1504 | (set-process-buffer (tramp-get-connection-process v) nil) |
| 1505 | (kill-buffer (current-buffer))) | 1505 | (kill-buffer (current-buffer))) |
| 1506 | (set-buffer-modified-p bmp))) | 1506 | (set-buffer-modified-p bmp))) |
| 1507 | (tramp-set-connection-property v "process-name" nil) | 1507 | (tramp-flush-connection-property v "process-name") |
| 1508 | (tramp-set-connection-property v "process-buffer" nil))))) | 1508 | (tramp-flush-connection-property v "process-buffer"))))) |
| 1509 | 1509 | ||
| 1510 | (defun tramp-smb-handle-substitute-in-file-name (filename) | 1510 | (defun tramp-smb-handle-substitute-in-file-name (filename) |
| 1511 | "Like `handle-substitute-in-file-name' for Tramp files. | 1511 | "Like `handle-substitute-in-file-name' for Tramp files. |
| @@ -1538,8 +1538,8 @@ errors for shares like \"C$/\", which are common in Microsoft Windows." | |||
| 1538 | 1538 | ||
| 1539 | ;; We must also flush the cache of the directory, because | 1539 | ;; We must also flush the cache of the directory, because |
| 1540 | ;; `file-attributes' reads the values from there. | 1540 | ;; `file-attributes' reads the values from there. |
| 1541 | (tramp-flush-file-property v (file-name-directory localname)) | 1541 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 1542 | (tramp-flush-file-property v localname) | 1542 | (tramp-flush-file-properties v localname) |
| 1543 | (let ((curbuf (current-buffer)) | 1543 | (let ((curbuf (current-buffer)) |
| 1544 | (tmpfile (tramp-compat-make-temp-file filename))) | 1544 | (tmpfile (tramp-compat-make-temp-file filename))) |
| 1545 | (when (and append (file-exists-p filename)) | 1545 | (when (and append (file-exists-p filename)) |
| @@ -1863,8 +1863,8 @@ If ARGUMENT is non-nil, use it as argument for | |||
| 1863 | tramp-smb-version | 1863 | tramp-smb-version |
| 1864 | (tramp-get-connection-property | 1864 | (tramp-get-connection-property |
| 1865 | vec "smbclient-version" tramp-smb-version)) | 1865 | vec "smbclient-version" tramp-smb-version)) |
| 1866 | (tramp-flush-directory-property vec "") | 1866 | (tramp-flush-directory-properties vec "") |
| 1867 | (tramp-flush-connection-property vec)) | 1867 | (tramp-flush-connection-properties vec)) |
| 1868 | 1868 | ||
| 1869 | (tramp-set-connection-property | 1869 | (tramp-set-connection-property |
| 1870 | vec "smbclient-version" tramp-smb-version))) | 1870 | vec "smbclient-version" tramp-smb-version))) |
| @@ -1965,8 +1965,8 @@ If ARGUMENT is non-nil, use it as argument for | |||
| 1965 | smbserver-version | 1965 | smbserver-version |
| 1966 | (tramp-get-connection-property | 1966 | (tramp-get-connection-property |
| 1967 | vec "smbserver-version" smbserver-version)) | 1967 | vec "smbserver-version" smbserver-version)) |
| 1968 | (tramp-flush-directory-property vec "") | 1968 | (tramp-flush-directory-properties vec "") |
| 1969 | (tramp-flush-connection-property vec)) | 1969 | (tramp-flush-connection-properties vec)) |
| 1970 | (tramp-set-connection-property | 1970 | (tramp-set-connection-property |
| 1971 | vec "smbserver-version" smbserver-version)))) | 1971 | vec "smbserver-version" smbserver-version)))) |
| 1972 | 1972 | ||
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index c73ec1de30f..398d91ef77f 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -2948,8 +2948,8 @@ User is always nil." | |||
| 2948 | localname))))) | 2948 | localname))))) |
| 2949 | (tramp-error v 'file-already-exists newname) | 2949 | (tramp-error v 'file-already-exists newname) |
| 2950 | (delete-file newname))) | 2950 | (delete-file newname))) |
| 2951 | (tramp-flush-file-property v (file-name-directory localname)) | 2951 | (tramp-flush-file-properties v (file-name-directory localname)) |
| 2952 | (tramp-flush-file-property v localname) | 2952 | (tramp-flush-file-properties v localname) |
| 2953 | (copy-file | 2953 | (copy-file |
| 2954 | filename newname 'ok-if-already-exists 'keep-time | 2954 | filename newname 'ok-if-already-exists 'keep-time |
| 2955 | 'preserve-uid-gid 'preserve-permissions))) | 2955 | 'preserve-uid-gid 'preserve-permissions))) |
| @@ -2993,7 +2993,7 @@ User is always nil." | |||
| 2993 | "Like `dired-uncache' for Tramp files." | 2993 | "Like `dired-uncache' for Tramp files." |
| 2994 | (with-parsed-tramp-file-name | 2994 | (with-parsed-tramp-file-name |
| 2995 | (if (file-directory-p dir) dir (file-name-directory dir)) nil | 2995 | (if (file-directory-p dir) dir (file-name-directory dir)) nil |
| 2996 | (tramp-flush-directory-property v localname))) | 2996 | (tramp-flush-directory-properties v localname))) |
| 2997 | 2997 | ||
| 2998 | (defun tramp-handle-file-accessible-directory-p (filename) | 2998 | (defun tramp-handle-file-accessible-directory-p (filename) |
| 2999 | "Like `file-accessible-directory-p' for Tramp files." | 2999 | "Like `file-accessible-directory-p' for Tramp files." |