My code is:

      <delete includeemptydirs="true">
         <fileset dir="dependencies">
            <exclude name="src/**"/>
         </fileset>
      </delete>

In this example, I do NOT have a "src" subdirectory so the exclude should do 
nothing.  The first time I run it, everything is deleted UNDER dependencies 
except for a few empty directories.  If I run a second time, then some more of 
those empty directories are deleted.  If I continue to run it again and again, 
eventually all empty directories are deleted including the dependencies top 
level directory itself.

How do I get everything to delete the first time?

---
Shawn Castrianni

-----Original Message-----
From: Knuplesch, Juergen [mailto:[email protected]] 
Sent: Friday, March 26, 2010 9:52 AM
To: Ant Users List
Subject: AW: delete task question

Please show us, what you want to do! 

If you just want to delete everything under a certain dir it should work with 
"**" in the fileset.

-- 
Jürgen 
-----Ursprüngliche Nachricht-----
Von: Shawn Castrianni [mailto:[email protected]] 
Gesendet: Freitag, 26. März 2010 15:41
An: 'Ant Users List'
Betreff: delete task question

I am trying to use the <delete> task to delete files AND directories.  I have 
turned on the includeemptydirs and am explicitly specifying a nested <fileset> 
instead of relying on the implicit one created by <delete> tag itself.  My 
question is about includeemptydirs.  It doesn't seem to work properly.  
Depending on what order the fileset iterates through the files/directories, you 
will get different behavior.  In order for everything to work, it would need to 
iterate from the leaf on up through its parents so that a parent that WILL be 
empty is deleted instead of being blocked because it still has a child 
directory which WILL be deleted later on during the iteration.  Is <delete> 
smart enough to iterate from the leaves on up?  If not, what is?

---
Shawn Castrianni

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and 
privileged information for the sole use of the intended recipient.  Any review, 
use, distribution, or disclosure by others is strictly prohibited.  If you are 
not the intended recipient (or authorized to receive information for the 
intended recipient), please contact the sender by reply e-mail and delete all 
copies of this message.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to