You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2008/09/04 15:20:20 UTC
svn commit: r692003 - /ant/core/trunk/docs/faq.html
Author: bodewig
Date: Thu Sep 4 06:20:19 2008
New Revision: 692003
URL: http://svn.apache.org/viewvc?rev=692003&view=rev
Log:
re-generate site
Modified:
ant/core/trunk/docs/faq.html
Modified: ant/core/trunk/docs/faq.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/faq.html?rev=692003&r1=692002&r2=692003&view=diff
==============================================================================
--- ant/core/trunk/docs/faq.html (original)
+++ ant/core/trunk/docs/faq.html Thu Sep 4 06:20:19 2008
@@ -291,6 +291,10 @@
How can I delete everything beneath a particular directory,
preserving the directory itself?
</a></li>
+ <li><a href="#delete-directory-only-if-empty">
+ How can I delete a particular directory,
+ if and only if it is empty?
+ </a></li>
</ul>
<h4 class="toc">It doesn't work (as expected)</h4>
<ul>
@@ -1167,6 +1171,22 @@
<fileset dir="dirtokeep" includes="**/*" />
</delete>
</pre>
+ <p class="faq">
+ <a name="delete-directory-only-if-empty"></a>
+ How can I delete a particular directory,
+ if and only if it is empty?
+ </p>
+ <p>Most users who go down this path have no problem figuring
+ out that
+ <code><delete includeemptydirs="true" /></code> will
+ help them. The seemingly tricky part is preserving the
+ non-empty directories, which Ant includes in the directory
+ scan. Fortunately the answer is simple:</p>
+ <pre class="code">
+<delete includeemptydirs="true">
+ <fileset dir="dirtokeepifnotempty" excludes="**/*" />
+</delete>
+</pre>
<p class="faq">
<a name="general-advice"></a>
General Advice