(with-tramp-file-property v localname "file-executable-p"
(file-executable-p (tramp-fuse-local-file-name filename)))))
+(defun tramp-fuse-handle-file-exists-p (filename)
+ "Like `file-exists-p' for Tramp files."
+ (tramp-skeleton-file-exists-p filename
+ (file-exists-p (tramp-fuse-local-file-name filename))))
+
(defun tramp-fuse-handle-file-name-all-completions (filename directory)
"Like `file-name-all-completions' for Tramp files."
(tramp-fuse-remove-hidden-files
(format "%s@%s:/" user host)
(format "%s:/" host)))
-(defun tramp-fuse-mount-point (vec)
- "Return local mount point of VEC."
- (or (tramp-get-file-property vec "/" "mount-point")
- (expand-file-name
- (concat
- tramp-temp-name-prefix
- (tramp-file-name-method vec) "."
- (when (tramp-file-name-user vec)
- (concat (tramp-file-name-user-domain vec) "@"))
- (tramp-file-name-host-port vec))
- (or small-temporary-file-directory
- tramp-compat-temporary-file-directory))))
-
(defconst tramp-fuse-mount-timeout
(eval (car (get 'remote-file-name-inhibit-cache 'standard-value)) t)
"Time period to check whether the mount point still exists.
It has the same meaning as `remote-file-name-inhibit-cache'.")
+(defun tramp-fuse-mount-point (vec)
+ "Return local mount point of VEC."
+ (let ((remote-file-name-inhibit-cache tramp-fuse-mount-timeout))
+ (or (tramp-get-file-property vec "/" "mount-point")
+ (expand-file-name
+ (concat
+ tramp-temp-name-prefix
+ (tramp-file-name-method vec) "."
+ (when (tramp-file-name-user vec)
+ (concat (tramp-file-name-user-domain vec) "@"))
+ (tramp-file-name-host-port vec))
+ tramp-compat-temporary-file-directory))))
+
(defun tramp-fuse-mounted-p (vec)
"Check, whether fuse volume determined by VEC is mounted."
;; Remember the mount status by using a file property on "/",
(command (format "%s -u %s" (tramp-fuse-get-fusermount) mount-point)))
(tramp-message vec 6 "%s\n%s" command (shell-command-to-string command))
(tramp-flush-file-property vec "/" "mounted")
+ (tramp-flush-file-property vec "/" "mount-point")
(setq tramp-fuse-mount-points
(delete (tramp-file-name-unify vec) tramp-fuse-mount-points))
;; Give the caches a chance to expire.
(file-directory-p . tramp-handle-file-directory-p)
(file-equal-p . tramp-handle-file-equal-p)
(file-executable-p . tramp-fuse-handle-file-executable-p)
- (file-exists-p . tramp-handle-file-exists-p)
+ (file-exists-p . tramp-fuse-handle-file-exists-p)
(file-group-gid . tramp-handle-file-group-gid)
(file-in-directory-p . tramp-handle-file-in-directory-p)
(file-local-copy . tramp-handle-file-local-copy)
;; Do not overwrite if excluded.
(cl-letf (((symbol-function #'y-or-n-p) #'tramp-compat-always)
;; Ange-FTP.
- ((symbol-function 'yes-or-no-p) #'tramp-compat-always))
+ ((symbol-function #'yes-or-no-p) #'tramp-compat-always))
(write-region "foo" nil tmp-name nil nil nil 'mustbenew))
(should-error
(cl-letf (((symbol-function #'y-or-n-p) #'ignore)
(insert "foo")
;; Bug#53207: with `create-lockfiles' nil, saving the
;; buffer results in a prompt.
- (cl-letf (((symbol-function 'yes-or-no-p)
- (lambda (_) (ert-fail "Test failed unexpectedly"))))
+ (cl-letf (((symbol-function #'read-from-minibuffer)
+ (lambda (&rest _)
+ (ert-fail "Test failed unexpectedly"))))
(should (buffer-modified-p))
(save-buffer)
(should-not (buffer-modified-p)))
;; modification time properly, for them it doesn't
;; make sense to test.
(when (not (verify-visited-file-modtime))
- (cl-letf (((symbol-function 'read-char-choice)
+ (cl-letf (((symbol-function #'read-char-choice)
(lambda (prompt &rest _) (message "%s" prompt) ?y)))
(ert-with-message-capture captured-messages
(insert "bar")
(should (file-locked-p tmp-name)))))
;; `save-buffer' removes the file lock.
- (cl-letf (((symbol-function 'yes-or-no-p)
+ (cl-letf (((symbol-function #'yes-or-no-p)
#'tramp-compat-always)
- ((symbol-function 'read-char-choice)
+ ((symbol-function #'read-char-choice)
(lambda (&rest _) ?y)))
(should (buffer-modified-p))
(save-buffer)