Now this is very strange.  The following workflow causes <delete> NOT to work:

1. run my ant dependencies command that creates the dependencies directory
2. Use Windows 7 Explorer to check 2 subdirectories within the dependencies 
directory to see its contents
3. run my ant clean.dependencies command with the code submitted in this thread
4. all subdirectories of dependencies are deleted EXCEPT for the 2 
subdirectories that I visited with Windows Explorer in Windows 7

This workflow causes <delete> TO work:

1. run my ant dependencies command that creates the dependencies directory
2. run my ant clean.dependencies command with the code submitted in this thread

So it looks like the act of me visiting directories within Windows Explorer is 
somehow preventing those directories from being deleted.  I have been sure NOT 
to leave windows explorer focused on any directory under dependencies or 
dependencies itself to prevent them from being locked.  This is weird.  I would 
guess it is NOT an ant bug?

---
Shawn Castrianni


-----Original Message-----
From: Shawn Castrianni [mailto:shawn.castria...@halliburton.com] 
Sent: Friday, March 26, 2010 10:48 AM
To: 'Ant Users List'
Subject: RE: delete task question

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:juergen.knuple...@icongmbh.de] 
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:shawn.castria...@halliburton.com] 
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: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to