Function: tramp-adb-handle-file-writable-p
tramp-adb-handle-file-writable-p is a byte-compiled function defined
in tramp-adb.el.gz.
Signature
(tramp-adb-handle-file-writable-p FILENAME)
Documentation
Like file-writable-p for Tramp files.
Source Code
;; Defined in /usr/src/emacs/lisp/net/tramp-adb.el.gz
(defun tramp-adb-handle-file-writable-p (filename)
"Like `file-writable-p' for Tramp files."
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-tramp-file-property v localname "file-writable-p"
(if (file-exists-p filename)
(if (tramp-file-property-p v localname "file-attributes")
;; Examine `file-attributes' cache to see if request can
;; be satisfied without remote operation.
(tramp-check-cached-permissions v ?w)
(tramp-adb-send-command-and-check
v (format "test -w %s" (tramp-shell-quote-argument localname))))
;; If file doesn't exist, check if directory is writable.
(and
(file-directory-p (file-name-directory filename))
(file-writable-p (file-name-directory filename)))))))