dired-delete-file

dired-delete-file is a compiled Lisp function in `dired.el'.

(dired-delete-file FILE &optional RECURSIVE TRASH)

Delete FILE or directory (possibly recursively if optional RECURSIVE is true.)
RECURSIVE determines what to do with a non-empty directory. If RECURSIVE is:
nil, do not delete.
`always', delete recursively without asking.
`top', ask for each directory at top level.
Anything else, ask for each sub-directory.