<delete>

[This is preliminary documentation and subject to change.]

Deletes a file, fileset or directory.

Deletes either a single file, all files in a specified directory and its sub-directories, or a set of files specified by one or more filesets.

Note: If the file attribute is set then the fileset contents will be ignored. To delete the files in the fileset ommit the file attribute in the <delete> element.

Note: Read-only files cannot be deleted. Use the <attrib> task first to remove the read-only attribute.

Parameters

Attribute Type Description Required
dir directory The directory to delete. False
file file The file to delete. False
failonerror bool Determines if task failure stops the build, or is just reported. The default is true. False
if bool If true then the task will be executed; otherwise, skipped. The default is true. False
unless bool Opposite of if. If false then the task will be executed; otherwise, skipped. The default is false. False
verbose bool Determines whether the task should report detailed build log messages. The default is false. False

Nested Elements:

<fileset>

All the files in the file set will be deleted.

</fileset>

Examples

Requirements

Assembly: NAnt.Core (0.85.1698.0)