"Like `file-truename' for Tramp files."
(with-parsed-tramp-file-name (expand-file-name filename) nil
(tramp-make-tramp-file-name method user host
- (with-file-property v localname "file-truename"
+ (with-tramp-file-property v localname "file-truename"
(let ((result nil)) ; result steps in reverse order
(tramp-message v 4 "Finding true name for `%s'" filename)
(cond
(defun tramp-sh-handle-file-exists-p (filename)
"Like `file-exists-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
- (with-file-property v localname "file-exists-p"
+ (with-tramp-file-property v localname "file-exists-p"
(or (not (null (tramp-get-file-property
v localname "file-attributes-integer" nil)))
(not (null (tramp-get-file-property
;; Don't modify `last-coding-system-used' by accident.
(let ((last-coding-system-used last-coding-system-used))
(with-parsed-tramp-file-name (expand-file-name filename) nil
- (with-file-property v localname (format "file-attributes-%s" id-format)
+ (with-tramp-file-property
+ v localname (format "file-attributes-%s" id-format)
(save-excursion
(tramp-convert-file-attributes
v
(defun tramp-remote-selinux-p (vec)
"Check, whether SELINUX is enabled on the remote host."
- (with-connection-property (tramp-get-connection-process vec) "selinux-p"
+ (with-tramp-connection-property
+ (tramp-get-connection-process vec) "selinux-p"
(let ((result (tramp-find-executable
vec "getenforce" (tramp-get-remote-path vec) t t)))
(and result
(defun tramp-sh-handle-file-selinux-context (filename)
"Like `file-selinux-context' for Tramp files."
(with-parsed-tramp-file-name filename nil
- (with-file-property v localname "file-selinux-context"
+ (with-tramp-file-property v localname "file-selinux-context"
(let ((context '(nil nil nil nil))
(regexp (concat "\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\):"
"\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\)")))
(defun tramp-sh-handle-file-executable-p (filename)
"Like `file-executable-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
- (with-file-property v localname "file-executable-p"
+ (with-tramp-file-property v localname "file-executable-p"
;; Examine `file-attributes' cache to see if request can be
;; satisfied without remote operation.
(or (tramp-check-cached-permissions v ?x)
(defun tramp-sh-handle-file-readable-p (filename)
"Like `file-readable-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
- (with-file-property v localname "file-readable-p"
+ (with-tramp-file-property v localname "file-readable-p"
;; Examine `file-attributes' cache to see if request can be
;; satisfied without remote operation.
(or (tramp-check-cached-permissions v ?r)
;; desirable to return t immediately for "/method:foo:". It can
;; be expected that this is always a directory.
(or (zerop (length localname))
- (with-file-property v localname "file-directory-p"
+ (with-tramp-file-property v localname "file-directory-p"
(tramp-run-test "-d" filename)))))
(defun tramp-sh-handle-file-writable-p (filename)
"Like `file-writable-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
- (with-file-property v localname "file-writable-p"
+ (with-tramp-file-property v localname "file-writable-p"
(if (file-exists-p filename)
;; Examine `file-attributes' cache to see if request can be
;; satisfied without remote operation.
(defun tramp-sh-handle-file-ownership-preserved-p (filename)
"Like `file-ownership-preserved-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
- (with-file-property v localname "file-ownership-preserved-p"
+ (with-tramp-file-property v localname "file-ownership-preserved-p"
(let ((attributes (file-attributes filename)))
;; Return t if the file doesn't exist, since it's true that no
;; information would be lost by an (attempted) delete and create.
(let* ((temp
(copy-tree
(with-parsed-tramp-file-name directory nil
- (with-file-property
+ (with-tramp-file-property
v localname
(format "directory-files-and-attributes-%s" id-format)
(save-excursion
(tramp-error
v 'file-already-exists "File %s already exists" newname))
- (tramp-with-progress-reporter
+ (with-tramp-progress-reporter
v 0 (format "%s %s to %s"
(if (eq op 'copy) "Copying" "Renaming")
filename newname)
nil)
((and suffix (nth 2 suffix))
;; We found an uncompression rule.
- (tramp-with-progress-reporter
+ (with-tramp-progress-reporter
v 0 (format "Uncompressing %s" file)
(when (tramp-send-command-and-check
v (concat (nth 2 suffix) " "
(t
;; We don't recognize the file as compressed, so compress it.
;; Try gzip.
- (tramp-with-progress-reporter v 0 (format "Compressing %s" file)
+ (with-tramp-progress-reporter v 0 (format "Compressing %s" file)
(when (tramp-send-command-and-check
v (concat "gzip -f "
(tramp-shell-quote-argument localname)))
(string-match "\\`su\\(do\\)?\\'" method))
(setq uname (concat uname user)))
(setq uname
- (with-connection-property v uname
+ (with-tramp-connection-property v uname
(tramp-send-command
v (format "cd %s; pwd" (tramp-shell-quote-argument uname)))
(with-current-buffer (tramp-get-buffer v)
;; Use inline encoding for file transfer.
(rem-enc
(save-excursion
- (tramp-with-progress-reporter
+ (with-tramp-progress-reporter
v 3 (format "Encoding remote file %s" filename)
(tramp-barf-unless-okay
v (format rem-enc (tramp-shell-quote-argument localname))
(with-temp-buffer
(set-buffer-multibyte nil)
(insert-buffer-substring (tramp-get-buffer v))
- (tramp-with-progress-reporter
+ (with-tramp-progress-reporter
v 3 (format "Decoding remote file %s with function %s"
filename loc-dec)
(funcall loc-dec (point-min) (point-max))
(let (file-name-handler-alist
(coding-system-for-write 'binary))
(write-region (point-min) (point-max) tmpfile2))
- (tramp-with-progress-reporter
+ (with-tramp-progress-reporter
v 3 (format "Decoding remote file %s with command %s"
filename loc-dec)
(unwind-protect
(set-buffer-multibyte nil)
;; Use encoding function or command.
(if (functionp loc-enc)
- (tramp-with-progress-reporter
+ (with-tramp-progress-reporter
v 3 (format "Encoding region using function `%s'"
loc-enc)
(let ((coding-system-for-read 'binary))
(tramp-compat-temporary-file-directory)))
(funcall loc-enc (point-min) (point-max))))
- (tramp-with-progress-reporter
+ (with-tramp-progress-reporter
v 3 (format "Encoding region using command `%s'"
loc-enc)
(unless (zerop (tramp-call-local-coding-command
;; Send buffer into remote decoding command which
;; writes to remote file. Because this happens on
;; the remote host, we cannot use the function.
- (tramp-with-progress-reporter
+ (with-tramp-progress-reporter
v 3
(format "Decoding region into remote file %s" filename)
(goto-char (point-max))
"Like `vc-registered' for Tramp files."
(tramp-compat-with-temp-message ""
(with-parsed-tramp-file-name file nil
- (tramp-with-progress-reporter
+ (with-tramp-progress-reporter
v 3 (format "Checking `vc-registered' for %s" file)
;; There could be new files, created by the vc backend. We
(let ((scripts (tramp-get-connection-property
(tramp-get-connection-process vec) "scripts" nil)))
(unless (member name scripts)
- (tramp-with-progress-reporter vec 5 (format "Sending script `%s'" name)
+ (with-tramp-progress-reporter vec 5 (format "Sending script `%s'" name)
;; The script could contain a call of Perl. This is masked with `%s'.
(tramp-barf-unless-okay
vec
(defun tramp-open-shell (vec shell)
"Opens shell SHELL."
- (tramp-with-progress-reporter
+ (with-tramp-progress-reporter
vec 5 (format "Opening remote shell `%s'" shell)
;; Find arguments for this shell.
(let ((tramp-end-of-output tramp-initial-end-of-output)
(tramp-file-name-method vec) 'tramp-remote-shell)))
shell)
(setq shell
- (with-connection-property vec "remote-shell"
+ (with-tramp-connection-property vec "remote-shell"
;; CCC: "root" does not exist always, see QNAP 459.
;; Which check could we apply instead?
(tramp-send-command vec "echo ~root" t)
(tramp-open-shell vec shell))
;; Busyboxes tend to behave strange. We check for the existence.
- (with-connection-property vec "busybox"
+ (with-tramp-connection-property vec "busybox"
(tramp-send-command vec (format "%s --version" shell) t)
(let ((case-fold-search t))
(and (string-match "busybox" (buffer-string)) t))))))
;; successfully, sending 625 bytes failed. Emacs makes a hack when
;; this host type is detected locally. It cannot handle remote
;; hosts, though.
- (with-connection-property proc "chunksize"
+ (with-tramp-connection-property proc "chunksize"
(cond
((and (integerp tramp-chunksize) (> tramp-chunksize 0))
tramp-chunksize)
(when (and (boundp 'non-essential) (symbol-value 'non-essential))
(throw 'non-essential 'non-essential))
- (tramp-with-progress-reporter
+ (with-tramp-progress-reporter
vec 3
(if (zerop (length (tramp-file-name-user vec)))
(format "Opening connection for %s using %s"
;; Variables local to connection.
(defun tramp-get-remote-path (vec)
- (with-connection-property
+ (with-tramp-connection-property
;; When `tramp-own-remote-path' is in `tramp-remote-path', we
;; cache the result for the session only. Otherwise, the result
;; is cached persistently.
remote-path)))))
(defun tramp-get-ls-command (vec)
- (with-connection-property vec "ls"
+ (with-tramp-connection-property vec "ls"
(tramp-message vec 5 "Finding a suitable `ls' command")
(or
(catch 'ls-found
(defun tramp-get-ls-command-with-dired (vec)
(save-match-data
- (with-connection-property vec "ls-dired"
+ (with-tramp-connection-property vec "ls-dired"
(tramp-message vec 5 "Checking, whether `ls --dired' works")
;; Some "ls" versions are sensible wrt the order of arguments,
;; they fail when "-al" is after the "--dired" argument (for
vec (format "%s --dired -al /dev/null" (tramp-get-ls-command vec))))))
(defun tramp-get-test-command (vec)
- (with-connection-property vec "test"
+ (with-tramp-connection-property vec "test"
(tramp-message vec 5 "Finding a suitable `test' command")
(if (tramp-send-command-and-check vec "test 0")
"test"
;; Does `test A -nt B' work? Use abominable `find' construct if it
;; doesn't. BSD/OS 4.0 wants the parentheses around the command,
;; for otherwise the shell crashes.
- (with-connection-property vec "test-nt"
+ (with-tramp-connection-property vec "test-nt"
(or
(progn
(tramp-send-command
"tramp_test_nt %s %s"))))
(defun tramp-get-file-exists-command (vec)
- (with-connection-property vec "file-exists"
+ (with-tramp-connection-property vec "file-exists"
(tramp-message vec 5 "Finding command to check if file exists")
(tramp-find-file-exists-command vec)))
(defun tramp-get-remote-ln (vec)
- (with-connection-property vec "ln"
+ (with-tramp-connection-property vec "ln"
(tramp-message vec 5 "Finding a suitable `ln' command")
(tramp-find-executable vec "ln" (tramp-get-remote-path vec))))
(defun tramp-get-remote-perl (vec)
- (with-connection-property vec "perl"
+ (with-tramp-connection-property vec "perl"
(tramp-message vec 5 "Finding a suitable `perl' command")
(let ((result
(or (tramp-find-executable vec "perl5" (tramp-get-remote-path vec))
vec "perl" (tramp-get-remote-path vec)))))
;; We must check also for some Perl modules.
(when result
- (with-connection-property vec "perl-file-spec"
+ (with-tramp-connection-property vec "perl-file-spec"
(tramp-send-command-and-check
vec (format "%s -e 'use File::Spec;'" result)))
- (with-connection-property vec "perl-cwd-realpath"
+ (with-tramp-connection-property vec "perl-cwd-realpath"
(tramp-send-command-and-check
vec (format "%s -e 'use Cwd \"realpath\";'" result))))
result)))
(defun tramp-get-remote-stat (vec)
- (with-connection-property vec "stat"
+ (with-tramp-connection-property vec "stat"
(tramp-message vec 5 "Finding a suitable `stat' command")
(let ((result (tramp-find-executable
vec "stat" (tramp-get-remote-path vec)))
result)))
(defun tramp-get-remote-readlink (vec)
- (with-connection-property vec "readlink"
+ (with-tramp-connection-property vec "readlink"
(tramp-message vec 5 "Finding a suitable `readlink' command")
(let ((result (tramp-find-executable
vec "readlink" (tramp-get-remote-path vec))))
result))))
(defun tramp-get-remote-trash (vec)
- (with-connection-property vec "trash"
+ (with-tramp-connection-property vec "trash"
(tramp-message vec 5 "Finding a suitable `trash' command")
(tramp-find-executable vec "trash" (tramp-get-remote-path vec))))
(defun tramp-get-remote-id (vec)
- (with-connection-property vec "id"
+ (with-tramp-connection-property vec "id"
(tramp-message vec 5 "Finding POSIX `id' command")
(or
(catch 'id-found
(tramp-error vec 'file-error "Couldn't find a POSIX `id' command"))))
(defun tramp-get-remote-uid (vec id-format)
- (with-connection-property vec (format "uid-%s" id-format)
+ (with-tramp-connection-property vec (format "uid-%s" id-format)
(let ((res (tramp-send-command-and-read
vec
(format "%s -u%s %s"
(if (and (equal id-format 'integer) (not (integerp res))) -1 res))))
(defun tramp-get-remote-gid (vec id-format)
- (with-connection-property vec (format "gid-%s" id-format)
+ (with-tramp-connection-property vec (format "gid-%s" id-format)
(let ((res (tramp-send-command-and-read
vec
(format "%s -g%s %s"
If no corresponding command is found, nil is returned."
(when (and (integerp tramp-inline-compress-start-size)
(> size tramp-inline-compress-start-size))
- (with-connection-property (tramp-get-connection-process vec) prop
+ (with-tramp-connection-property (tramp-get-connection-process vec) prop
(tramp-find-inline-compress vec)
(tramp-get-connection-property
(tramp-get-connection-process vec) prop nil))))
;; no inline coding is found.
(ignore-errors
(let ((coding
- (with-connection-property (tramp-get-connection-process vec) prop
+ (with-tramp-connection-property
+ (tramp-get-connection-process vec) prop
(tramp-find-inline-encoding vec)
(tramp-get-connection-property
(tramp-get-connection-process vec) prop nil)))