tramp-devel
[Top][All Lists]
Advanced

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

[PATCH 1/1] * tramp.el (tramp-handle-file-exists-p): Check file-attribut


From: Julian Scheid
Subject: [PATCH 1/1] * tramp.el (tramp-handle-file-exists-p): Check file-attributes cache, assume file exists if cache value present.
Date: Sat, 15 Aug 2009 18:02:45 +1200

---
 lisp/ChangeLog |    5 +++++
 lisp/tramp.el  |   16 ++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d52781c..d23b8ac 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-15  Julian Scheid  <address@hidden>
+
+       * tramp.el (tramp-handle-file-exists-p): Check file-attributes
+       cache, assume file exists if cache value present.
+
 2009-08-14  Michael Albinus  <address@hidden>
 
        * tramp.el (tramp-message-show-message): New defvar.
diff --git a/lisp/tramp.el b/lisp/tramp.el
index 1ecae2c..a72cb34 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -2516,12 +2516,16 @@ target of the symlink differ."
   "Like `file-exists-p' for Tramp files."
   (with-parsed-tramp-file-name filename nil
     (with-file-property v localname "file-exists-p"
-      (zerop (tramp-send-command-and-check
-             v
-             (format
-              "%s %s"
-              (tramp-get-file-exists-command v)
-              (tramp-shell-quote-argument localname)))))))
+      (or (not (null (tramp-get-file-property
+                      v localname "file-attributes-integer" nil)))
+          (not (null (tramp-get-file-property
+                      v localname "file-attributes-string" nil)))
+          (zerop (tramp-send-command-and-check
+                  v
+                  (format
+                   "%s %s"
+                   (tramp-get-file-exists-command v)
+                   (tramp-shell-quote-argument localname))))))))
 
 ;; Inodes don't exist for some file systems.  Therefore we must
 ;; generate virtual ones.  Used in `find-buffer-visiting'.  The method
-- 
1.6.4





reply via email to

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