Variable: org-babel-tangle-remove-file-before-write
org-babel-tangle-remove-file-before-write is a customizable variable
defined in ob-tangle.el.gz.
Value
auto
Documentation
How to overwrite the existing tangle target.
When set to nil, org-babel-tangle will replace contents of an existing
tangle target (and fail when tangle target is read-only).
When set to t, the tangle target (including read-only) will be deleted
first and a new file, possibly with different ownership and
permissions, will be created.
When set to symbol auto, overwrite read-only tangle targets and
replace contents otherwise.
This variable was added, or its default value changed, in Org version
9.7.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ob-tangle.el.gz
(defcustom org-babel-tangle-remove-file-before-write 'auto
"How to overwrite the existing tangle target.
When set to nil, `org-babel-tangle' will replace contents of an existing
tangle target (and fail when tangle target is read-only).
When set to t, the tangle target (including read-only) will be deleted
first and a new file, possibly with different ownership and
permissions, will be created.
When set to symbol `auto', overwrite read-only tangle targets and
replace contents otherwise."
:group 'org-babel-tangle
:package-version '(Org . "9.7")
:type '(choice
(const :tag "Replace contents, but keep the same file" nil)
(const :tag "Re-create file" t)
(const :tag "Re-create when read-only" auto))
:safe t)