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-data | Hash table for remote files properties. |
tramp-cache-data-changed | Whether persistent cache data have been changed. |
tramp-cache-read-persistent-data | Whether to read persistent data at startup time. |
tramp-cache-undefined | The symbol marking undefined hash keys and values. |
tramp-cache-version | Virtual connection vector for Tramp version. |
tramp-completion-use-cache | Whether to use the Tramp cache for completion of user and host names. |
tramp-connection-properties | List of static connection properties. |
tramp-persistency-file-name | File which keeps connection history for Tramp connections. |