Browse Source

add FAQ about deleting a directory only if it is empty. PR 44013. submitted by Vincent Legoll

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@692000 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
9b51b4613f
3 changed files with 24 additions and 0 deletions
  1. +1
    -0
      CONTRIBUTORS
  2. +4
    -0
      contributors.xml
  3. +19
    -0
      xdocs/faq.xml

+ 1
- 0
CONTRIBUTORS View File

@@ -290,6 +290,7 @@ Tom Dimock
Tom Eugelink Tom Eugelink
Ulrich Schmidt Ulrich Schmidt
Victor Toni Victor Toni
Vincent Legoll
Waldek Herka Waldek Herka
Will Wang Will Wang
William Ferguson William Ferguson


+ 4
- 0
contributors.xml View File

@@ -1171,6 +1171,10 @@
<first>Victor</first> <first>Victor</first>
<last>Toni</last> <last>Toni</last>
</name> </name>
<name>
<first>Vincent</first>
<last>Legoll</last>
</name>
<name> <name>
<first>Will</first> <first>Will</first>
<last>Wang</last> <last>Wang</last>


+ 19
- 0
xdocs/faq.xml View File

@@ -717,6 +717,25 @@ shell-prompt> m4 foo.m4 > foo
<delete includeemptydirs="true"> <delete includeemptydirs="true">
<fileset dir="dirtokeep" includes="**/*" /> <fileset dir="dirtokeep" includes="**/*" />
</delete> </delete>
]]></source>
</answer>
</faq>

<faq id="delete-directory-only-if-empty">
<question>How can I delete a particular directory,
if and only if it is empty?</question>
<answer>
<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
non-empty directories, which Ant includes in the directory
scan. Fortunately the answer is simple:</p>

<source><![CDATA[
<delete includeemptydirs="true">
<fileset dir="dirtokeepifnotempty" excludes="**/*" />
</delete>
]]></source> ]]></source>
</answer> </answer>
</faq> </faq>


Loading…
Cancel
Save