ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r495698 - /ant/core/trunk/docs/faq.html
Date Fri, 12 Jan 2007 19:33:40 GMT
Author: mbenson
Date: Fri Jan 12 11:33:39 2007
New Revision: 495698

URL: http://svn.apache.org/viewvc?view=rev&rev=495698
Log:
add FAQ about deleting directory contents while preserving top-level directory.

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?view=diff&rev=495698&r1=495697&r2=495698
==============================================================================
--- ant/core/trunk/docs/faq.html (original)
+++ ant/core/trunk/docs/faq.html Fri Jan 12 11:33:39 2007
@@ -255,10 +255,14 @@
   How can I do something like <code>&lt;property name="prop"
       value="${${anotherprop}}"/&gt;</code> (double expanding the property)?
       </a></li>
+                <li><a href="#delete-directory-children-only">
+  How can I delete everything beneath a particular directory,
+      preserving the directory itself?
+      </a></li>
             </ul>
                 <h4 class="toc">It doesn't work (as expected)</h4>
         <ul>
-                <li><a href="#genral-advice">
+                <li><a href="#general-advice">
   General Advice
       </a></li>
                 <li><a href="#always-recompiles">
@@ -1085,8 +1089,23 @@
   &lt;/sequential&gt;
 &lt;/macrodef&gt;
 </pre>
+                    <p class="faq">
+      <a name="delete-directory-children-only" />
+  How can I delete everything beneath a particular directory,
+      preserving the directory itself?
+    </p>
+<p>Most users who go down this path have no problem figuring out that
+  <code>&lt;delete includeemptydirs="true" /&gt;</code> will help them.
 The
+  seemingly tricky part is preserving the base directory itself,
+  which Ant includes in the directory scan. Fortunately the answer is simple:
+</p>
+<pre class="code">
+&lt;delete includeemptydirs="true"&gt;
+  &lt;fileset dir="dirtokeep" includes="**/*" /&gt;
+&lt;/delete&gt;
+</pre>
                                 <p class="faq">
-      <a name="genral-advice"></a>
+      <a name="general-advice"></a>
       General Advice
     </p>
                   <p>There are many reasons why Ant doesn't behave as
@@ -2029,14 +2048,3 @@
       </p>
     </body>
   </html>
-
-
-
-
-
-
-
-
-
-
-



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message