Function: hypb:chmod

hypb:chmod is a byte-compiled function defined in hypb.el.

Signature

(hypb:chmod OP OCTAL-PERMISSIONS FILE)

Documentation

Use OP and OCTAL-PERMISSIONS integer to set FILE permissions.

OP may be +, -, xor, or default =.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hypb.el
(defun hypb:chmod (op octal-permissions file)
  "Use OP and OCTAL-PERMISSIONS integer to set FILE permissions.
OP may be +, -, xor, or default =."
  (let ((func (cond ((eq op '+)   #'logior)
		    ((eq op '-)   (lambda (p1 p2) (logand (lognot p1) p2)))
		    ((eq op 'xor) #'logxor)
		    (t            (lambda (p1 p2) p2 p1)))))
    (set-file-modes file (funcall func (hypb:oct-to-int octal-permissions)
				  (file-modes file)))))