emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master f3328f9: Rework tramp-rclone-mounted-p


From: Michael Albinus
Subject: [Emacs-diffs] master f3328f9: Rework tramp-rclone-mounted-p
Date: Mon, 26 Nov 2018 13:48:47 -0500 (EST)

branch: master
commit f3328f995ee316cffa1a86117e6da2ba299d2c90
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Rework tramp-rclone-mounted-p
    
    * lisp/net/tramp-rclone.el (tramp-rclone-mounted-p): Rewrite.
    (tramp-rclone-maybe-open-connection): Set "mounted" file property.
---
 lisp/net/tramp-rclone.el | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el
index 725a6f1..a1767ab 100644
--- a/lisp/net/tramp-rclone.el
+++ b/lisp/net/tramp-rclone.el
@@ -435,15 +435,10 @@ file names."
 
 (defun tramp-rclone-mounted-p (vec)
   "Check, whether storage system determined by VEC is mounted."
-  (or
-   ;; We set this property at the end of
-   ;; `tramp-rclone-maybe-open-connection'.  Let's use it as
-   ;; indicator.
-   (tramp-get-connection-property vec "uid-integer" nil)
-   ;; If it is mounted, "." is not shown.  If the endpoint is not
-   ;; connected, `directory-files' returns an error.
-   (ignore-errors
-     (not (member "." (directory-files (tramp-rclone-mount-point vec)))))))
+  (with-tramp-file-property vec "/" "mounted"
+    (string-match
+     (format "^%s:" (regexp-quote (tramp-file-name-host vec)))
+     (shell-command-to-string "mount"))))
 
 (defun tramp-rclone-flush-mount (vec)
   "Flush directory cache of VEC mount."
@@ -511,6 +506,7 @@ connection if a previous connection has died for some 
reason."
                          (tramp-compat-temporary-file-directory)))
                    (apply 'start-process (tramp-get-connection-name vec) buf
                           tramp-rclone-program (delq nil args)))))
+         (tramp-set-file-property vec "/" "mounted" t)
          (tramp-message
           vec 6 "%s" (mapconcat 'identity (process-command p) " "))
          (process-put p 'adjust-window-size-function 'ignore)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]