mirror of
https://github.com/apache/ant.git
synced 2025-05-18 22:14:47 +00:00
PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271160 13f79535-47bb-0310-9956-ffa450edef68
98 lines
3.4 KiB
HTML
98 lines
3.4 KiB
HTML
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Language" content="en-us">
|
|
<title>Delete Task</title>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h2><a name="delete">Delete</a></h2>
|
|
<h3>Description</h3>
|
|
<p>Deletes a single file, a specified directory and all its files and
|
|
subdirectories, or a set of files specified by one or more
|
|
<a href="../CoreTypes/fileset.html">FileSet</a>s.
|
|
When specifying a set of files, empty directories are <i>not</i> removed by
|
|
default.
|
|
To remove empty directories, use the <code>includeEmptyDirs</code> attribute.
|
|
</p>
|
|
<h3>Parameters</h3>
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td valign="top"><b>Attribute</b></td>
|
|
<td valign="top"><b>Description</b></td>
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">file</td>
|
|
<td valign="top">The file to delete.</td>
|
|
<td align="center" valign="middle" rowspan="2">At least one of the two, unless a <code><fileset></code> is specified.</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">dir</td>
|
|
<td valign="top">The directory to delete, including all its files and subdirectories.</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">verbose</td>
|
|
<td valign="top">Show the name of each deleted file ("true"/"false").
|
|
Default is "false" when omitted.</td>
|
|
<td align="center" valign="top">No</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">quiet</td>
|
|
<td valign="top">If the file does not exist, do not display a diagnostic
|
|
message (unless Ant
|
|
has been invoked with the <code>‑verbose</code> or
|
|
<code>‑debug</code> switches) or modify the exit status to
|
|
reflect an error.
|
|
When set to "true", if a file or directory cannot be deleted,
|
|
no error is reported. This setting emulates the
|
|
<code>-f</code> option to the Unix <em>rm</em> command.
|
|
Default is "false".
|
|
Setting this to "true" implies setting
|
|
<code>failonerror</code> to "false".
|
|
</td>
|
|
<td align="center" valign="top">No</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">failonerror</td>
|
|
<td valign="top">
|
|
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 <code>quiet</code> is "false".
|
|
Default is "true".
|
|
</td>
|
|
<td align="center" valign="top">No</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">includeEmptyDirs</td>
|
|
<td valign="top">Set to "true" to delete empty directories when
|
|
using filesets. Default is "false".</td>
|
|
<td align="center" valign="top">No</td>
|
|
</tr>
|
|
</table>
|
|
<h3>Examples</h3>
|
|
<pre> <delete file="/lib/ant.jar"/></pre>
|
|
<p>deletes the file <code>/lib/ant.jar</code>.</p>
|
|
<pre> <delete dir="lib"/></pre>
|
|
<p>deletes the <code>lib</code> directory, including all files
|
|
and subdirectories of <code>lib</code>.</p>
|
|
<pre> <delete>
|
|
<fileset dir="." includes="**/*.bak"/>
|
|
</delete>
|
|
</pre>
|
|
<p>deletes all files with the extension <code>.bak</code> from the current directory
|
|
and any subdirectories.</p>
|
|
<pre> <delete includeEmptyDirs="true" >
|
|
<fileset dir="build" />
|
|
</delete>
|
|
</pre>
|
|
<p>deletes all files and subdirectories of <code>build</code>, including
|
|
<code>build</code> itself.</p>
|
|
<hr><p align="center">Copyright © 2001-2002 Apache Software Foundation.
|
|
All rights Reserved.</p>
|
|
|
|
</body>
|
|
</html>
|
|
|