Function: tramp-flush-directory-properties

tramp-flush-directory-properties is an autoloaded and byte-compiled function defined in tramp-cache.el.gz.

Signature

(tramp-flush-directory-properties KEY DIRECTORY)

Documentation

Remove all properties of DIRECTORY in the cache context of KEY.

Remove also properties of all files in subdirectories.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-cache.el.gz
;;;###tramp-autoload
(defun tramp-flush-directory-properties (key directory)
  "Remove all properties of DIRECTORY in the cache context of KEY.
Remove also properties of all files in subdirectories."
  (let* ((directory (directory-file-name (file-name-unquote directory)))
	 (truename (tramp-get-file-property key directory "file-truename")))
    (tramp-message key 8 "%s" directory)
    (dolist (key (hash-table-keys tramp-cache-data))
      (when (and (tramp-file-name-p key)
		 (stringp (tramp-file-name-localname key))
		 (tramp-compat-string-search
		  directory (tramp-file-name-localname key)))
	(remhash key tramp-cache-data)))
    ;; Remove file properties of symlinks.
    (when (and (stringp truename)
	       (not (string-equal directory (directory-file-name truename))))
      (tramp-flush-directory-properties key truename))
    ;; Remove selected properties of upper directory.
    (tramp-flush-file-upper-properties key directory)))