Deletes a single file, a specified directory and all its files and
subdirectories, or a set of files specified by one or more
When specifying a set of files, empty directories are not removed by
To remove empty directories, use the
If you use this task to delete temporary files created by editors
and it doesn't seem to work, read up on the
default exclusion set
in Directory-based Tasks, and see the
defaultexcludes attribute below.
|file||The file to delete, specified as either the simple filename (if the file exists in the current base directory), a relative-path filename, or a full-path filename.||At least one of the two,
|dir||The directory to delete, including all its files and
WARNING: Do not set
|verbose||Show the name of each deleted file ("true"/"false"). Default is "false" when omitted.||No|
|quiet||If the specified file or directory does not exist,
do not display a diagnostic message (unless Ant
has been invoked with the
Controls whether an error (such as a failure to delete a file)
stops the build or is merely reported to the screen.
Only relevant if
|includeEmptyDirs||Set to "true" to delete empty directories when using filesets. Default is "false".||No|
|defaultexcludes||Indicates whether default excludes should be used or not ("yes"/"no"). Default excludes are used when omitted.||No|
deletes the file
lib directory, including all files
and subdirectories of
<delete> <fileset dir="." includes="**/*.bak"/> </delete>
deletes all files with the extension
.bak from the current directory
and any subdirectories.
<delete includeEmptyDirs="true"> <fileset dir="build"/> </delete>
deletes all files and subdirectories of
Copyright © 2000-2002,2004 The Apache Software Foundation. All rights Reserved.