File: tramp-cache.el.html

An implementation of information caching for remote files.

Each connection, identified by a tramp-file-name structure or by a process, has a unique cache. We distinguish several kinds of caches, depending on the key:

- localname is nil. These are reusable properties. Examples:
  "remote-shell" identifies the POSIX shell to be called on the
  remote host, or "perl" is the command to be called on the remote
  host when starting a Perl script. These properties are saved in
  the file tramp-persistency-file-name.

- localname is an absolute file name. These are temporary
  properties, which are related to the file localname is referring
  to. Examples: "file-exists-p" is t or nil, depending on the file
  existence, or "file-attributes" caches the result of the function
  file-attributes. These entries have a timestamp, and they
  expire after remote-file-name-inhibit-cache seconds if this
  variable is set.

- The key is a process. These are temporary properties related to
  an open connection. Examples: "scripts" keeps shell script
  definitions already sent to the remote shell, "last-cmd-time" is
  the timestamp a command has been sent to the remote process.

- The key is tramp-null-hop or nil. These are temporary
  properties related to the local machine. If the key is nil, it
  is silently converted into tramp-null-hop.
  Examples: "parse-passwd" and "parse-group" keep the results of
  parsing "/etc/passwd" and "/etc/group",
  "{uid,gid}-{integer,string}" are the local uid and gid, and
  "locale" is the used shell locale. "user-host-completions" keeps
  the reachable hosts for the commands in tramp-container.el.

- The key is tramp-cache-version. It keeps the Tramp version the
  cache data was produced with. If the cache is read by another
  Tramp version, it is flushed.

- The key is tramp-cache-undefined. All functions return the
  expected values, but nothing is cached.

Some properties are handled special:

- "process-name", "process-buffer", "first-password-request" and
  "pw-spec" are not saved in the file
  tramp-persistency-file-name, although being connection
  properties related to a tramp-file-name structure.

- Reusable properties, which should not be saved, are kept in the
  process key retrieved by tramp-get-process (the main connection
  process). Other processes could reuse these properties, avoiding
  recomputation when a new asynchronous process is created by
  make-process. Examples are "unsafe-temporary-file",
  "remote-path", "device" (tramp-adb.el) or "share" (tramp-gvfs.el).

Defined variables (8)

tramp-cache-dataHash table for remote files properties.
tramp-cache-data-changedWhether persistent cache data have been changed.
tramp-cache-read-persistent-dataWhether to read persistent data at startup time.
tramp-cache-undefinedThe symbol marking undefined hash keys and values.
tramp-cache-versionVirtual connection vector for Tramp version.
tramp-completion-use-cacheWhether to use the Tramp cache for completion of user and host names.
tramp-connection-propertiesList of static connection properties.
tramp-persistency-file-nameFile which keeps connection history for Tramp connections.

Defined functions (24)

tramp-cache-print(TABLE)
tramp-connection-property-p(KEY PROPERTY)
tramp-dump-connection-properties()
tramp-file-property-p(KEY FILE PROPERTY)
tramp-flush-connection-properties(KEY)
tramp-flush-connection-property(KEY PROPERTY)
tramp-flush-directory-properties(KEY DIRECTORY)
tramp-flush-file-function()
tramp-flush-file-properties(KEY FILE)
tramp-flush-file-property(KEY FILE PROPERTY)
tramp-flush-file-upper-properties(KEY FILE)
tramp-get-connection-property(KEY PROPERTY &optional DEFAULT)
tramp-get-file-property(KEY FILE PROPERTY &optional DEFAULT)
tramp-get-hash-table(KEY)
tramp-list-connections()
tramp-parse-connection-properties(METHOD)
tramp-set-connection-property(KEY PROPERTY VALUE)
tramp-set-file-property(KEY FILE PROPERTY VALUE)
with-tramp-connection-property(KEY PROPERTY &rest BODY)
with-tramp-file-property(KEY FILE PROPERTY &rest BODY)
with-tramp-saved-connection-properties(KEY PROPERTIES &rest BODY)
with-tramp-saved-connection-property(KEY PROPERTY &rest BODY)
with-tramp-saved-file-properties(KEY FILE PROPERTIES &rest BODY)
with-tramp-saved-file-property(KEY FILE PROPERTY &rest BODY)

Defined faces (0)