diff --git a/docs/faq.html b/docs/faq.html index 4ca8174c8..a30f338d0 100644 --- a/docs/faq.html +++ b/docs/faq.html @@ -290,6 +290,10 @@
  • How can I delete everything beneath a particular directory, preserving the directory itself? +
  • +
  • + How can I delete a particular directory, + if and only if it is empty?
  • It doesn't work (as expected)

    @@ -1166,6 +1170,22 @@ shell-prompt> m4 foo.m4 > foo <delete includeemptydirs="true"> <fileset dir="dirtokeep" includes="**/*" /> </delete> + +

    + + How can I delete a particular directory, + if and only if it is empty? +

    +

    Most users who go down this path have no problem figuring + out that + <delete includeemptydirs="true" /> 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:

    +
    +<delete includeemptydirs="true">
    +  <fileset dir="dirtokeepifnotempty" excludes="**/*" />
    +</delete>