Function: f-delete

f-delete is a byte-compiled function defined in f.el.

Signature

(f-delete PATH &optional FORCE)

Documentation

Delete PATH, which can be file or directory.

If FORCE is t, a directory will be deleted recursively.

Other relevant functions are documented in the f group.

Shortdoc

;; f
(f-delete "dir")
    -> [it depends]
  (f-delete "other/dir" t)
    -> [it depends]
  (f-delete "path/to/file.txt")
    -> [it depends]

Source Code

;; Defined in ~/.emacs.d/elpa/f-20241003.1131/f.el
(defun f-delete (path &optional force)
  "Delete PATH, which can be file or directory.

If FORCE is t, a directory will be deleted recursively."
  (f--destructive path
    (if (or (f-file-p path) (f-symlink-p path))
        (delete-file path)
      (delete-directory path force))))