Function: org-persist--check-write-access

org-persist--check-write-access is a byte-compiled function defined in org-persist.el.gz.

Signature

(org-persist--check-write-access PATH)

Documentation

Check write access to all missing directories in PATH.

Show message and return nil if there is no write access. Otherwise, return t.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-persist.el.gz
(defun org-persist--check-write-access (path)
  "Check write access to all missing directories in PATH.
Show message and return nil if there is no write access.
Otherwise, return t."
  (let* ((dir (directory-file-name (file-name-as-directory path)))
         (prev dir))
    (while (and (not (file-exists-p dir))
                (setq prev dir)
                (not (equal dir (setq dir (directory-file-name
                                         (file-name-directory dir)))))))
    (if (file-writable-p prev) t ; return t
      (message "org-persist: Missing write access rights to: %S" prev)
      ;; return nil
      nil)))