Function: tramp-set-file-property

tramp-set-file-property is an autoloaded and byte-compiled function defined in tramp-cache.el.gz.

Signature

(tramp-set-file-property KEY FILE PROPERTY VALUE)

Documentation

Set the PROPERTY of FILE to VALUE, in the cache context of KEY.

Return VALUE.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-cache.el.gz
;;;###tramp-autoload
(defun tramp-set-file-property (key file property value)
  "Set the PROPERTY of FILE to VALUE, in the cache context of KEY.
Return VALUE."
  ;; Unify localname.  Remove hop from `tramp-file-name' structure.
  (setq file (tramp-compat-file-name-unquote file)
	key (copy-tramp-file-name key))
  (setf (tramp-file-name-localname key)
	(tramp-run-real-handler #'directory-file-name (list file))
	(tramp-file-name-hop key) nil)
  (let ((hash (tramp-get-hash-table key)))
    ;; We put the timestamp there.
    (puthash property (cons (current-time) value) hash)
    (tramp-message key 8 "%s %s %s" file property value)
    ;; For analysis purposes, count the number of setting this file attribute.
    (when (>= tramp-verbose 10)
      (let* ((var (intern (concat "tramp-cache-set-count-" property)))
	     (val (or (and (boundp var) (numberp (symbol-value var))
			   (symbol-value var))
		      0)))
	(set var (1+ val))))
    value))