>From f995a2d37a2da3e6bea4a1cecebd9b0aa353ed04 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 29 May 2011 17:39:06 +0200 Subject: [PATCH 2/9] Add `tramp-adb-handle-set-file-modes'. --- tramp-adb.el | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/tramp-adb.el b/tramp-adb.el index 9120d1e..e96d880 100644 --- a/tramp-adb.el +++ b/tramp-adb.el @@ -83,6 +83,7 @@ (file-readable-p . tramp-handle-file-exists-p) (file-writable-p . tramp-adb-handle-file-writable-p) (file-local-copy . tramp-adb-handle-file-local-copy) + (file-modes . tramp-handle-file-modes) (expand-file-name . tramp-adb-handle-expand-file-name) (find-backup-file-name . tramp-handle-find-backup-file-name) (directory-files . tramp-adb-handle-directory-files) @@ -96,6 +97,7 @@ (unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory) (vc-registered . ignore) ;no vc control files on Android devices (write-region . tramp-adb-handle-write-region) + (set-file-modes . tramp-adb-handle-set-file-modes) (rename-file . tramp-sh-handle-rename-file)) "Alist of handler functions for Tramp ADB method.") @@ -472,6 +474,14 @@ pass to the OPERATION." v 'file-error "Buffer has changed from `%s' to `%s'" curbuf (current-buffer)))))) +(defun tramp-adb-handle-set-file-modes (filename mode) + "Like `set-file-modes' for Tramp files." + (with-parsed-tramp-file-name filename nil + (tramp-flush-file-property v localname) + (tramp-adb-barf-unless-okay + v (format "chmod %s %s" (tramp-compat-decimal-to-octal mode) localname) + "Error while changing file's mode %s" filename))) + ;;; Android doesn't provide test command (defun tramp-adb-handle-file-exists-p (filename) -- 1.7.4.1