Deletes a file, fileset or directory.
For a list of all members of this type, see DeleteTask Members.
System.Object
NAnt.Core.Element
NAnt.Core.Task
NAnt.Core.Tasks.DeleteTask
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
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.
If the File or Directory attribute is set then the fileset contents will be ignored. To delete the files in the fileset ommit the File and Directory attributes in the <delete>
element.
If the specified file or directory does not exist, no error is reported.
Note Read-only files cannot be deleted. Use the AttribTask first to remove the read-only attribute.
Delete a single file.
<delete file="myfile.txt" />
Delete a directory and the contents within. If the directory does not exist, no error is reported.
<delete dir="${build.dir}" />
Delete a set of files.
<delete> <fileset> <include name="${basename}-??.exe" /> <include name="${basename}-??.pdb" /> </fileset> </delete>
Namespace: NAnt.Core.Tasks
Assembly: NAnt.Core (in NAnt.Core.dll)
DeleteTask Members | NAnt.Core.Tasks Namespace