Internal Function delete-directory-tree

Package:

UIOP/FILESYSTEM

Syntax:

  delete-directory-tree DIRECTORY-PATHNAME &KEY VALIDATE IF-DOES-NOT-EXISTresult

Arguments and Values:

Description:

Delete a directory including all its recursive contents, aka rm -rf.

To reduce the risk of infortunate mistakes, DIRECTORY-PATHNAME must be a physical non-wildcard directory pathname (not namestring).

If the directory does not exist, the IF-DOES-NOT-EXIST argument specifies what happens: if it is :ERROR (the default), an error is signaled, whereas if it is :IGNORE, nothing is done.

Furthermore, before any deletion is attempted, the DIRECTORY-PATHNAME must pass the validation function designated (as per ENSURE-FUNCTION) by the VALIDATE keyword argument which in practice is thus compulsory, and validates by returning a non-NIL result. If you're suicidal or extremely confident, just use :VALIDATE T.