Function: tramp-sh-handle-set-file-modes

tramp-sh-handle-set-file-modes is a byte-compiled function defined in tramp-sh.el.gz.

Signature

(tramp-sh-handle-set-file-modes FILENAME MODE &optional FLAG)

Documentation

Like set-file-modes for Tramp files.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
(defun tramp-sh-handle-set-file-modes (filename mode &optional flag)
  "Like `set-file-modes' for Tramp files."
  (with-parsed-tramp-file-name filename nil
    ;; We need "chmod -h" when the flag is set.
    (when (or (not (eq flag 'nofollow))
	      (not (file-symlink-p filename))
	      (tramp-get-remote-chmod-h v))
      (tramp-flush-file-properties v localname)
      ;; FIXME: extract the proper text from chmod's stderr.
      (tramp-barf-unless-okay
       v
       (format
	"chmod %s %o %s"
	(if (and (eq flag 'nofollow) (tramp-get-remote-chmod-h v)) "-h" "")
	mode (tramp-shell-quote-argument localname))
       "Error while changing file's mode %s" filename))))