ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Davidson" <>
Subject RE: Delete Files and SubFolders
Date Mon, 27 Sep 2004 22:10:44 GMT

If you're using Ant 1.6.2 (I do not know which earlier distributions
this same syntax may apply to) I'm pretty sure you can simply use:

<delete dir="/bin/blocks" />
<delete dir="/conf" />
(taken from

I was using this approach (under Windows) to implement the "scorched
earth" approach to checking out files for my master build, i.e.  <delete
dir=${my_checkout_dir}" />

~Jeff D.

-----Original Message-----
From: Brent Bain [] 
Sent: September 27, 2004 15:06
To: ''
Subject: Delete Files and SubFolders


I am trying to use the following code to delete everything under
subfolders (including deleting the subfolders themselves).  I can't seem
to get it to work.  I'm not sure if it's because I'm using a <path> or
not.  I'm using the antcontrib task to convert the path to a fileset
(<pathtofileset>) -- my code looks like this:
 <path id="codeBase.pathList">
  <fileset dir="${deploy.codeBase}">
   <include name="bin/**" />
   <include name="conf/**" />
 <target name="All">
  <property name="deploy.codeBase" value="c:/deploy/" />
  <pathtofileset name="delBase.pathList.fileset"
pathrefid="codeBase.pathList" />
  <delete includeEmptyDirs="true">
   <fileset refid="delBase.pathList.fileset" />
This deletes the FILES but not the folders.
My directory structure looks like:
What I'm trying to do is delete /bin/blocks/ and /conf/ completey.
If anyone can help I'd greatly appreciate it!
This electronic message transmission, including attachments, is for the exclusive use of the
individuals to which this e-mail is addressed and is to be reviewed and used exclusively for
authorized company purposes.  This transmission may contain proprietary, confidential or privileged
information.  If you are not the intended recipient of this transmission, you are hereby notified
that any use, copying, disclosure, dissemination, distribution or taking of any action in
reliance upon the contents of this transmission is strictly prohibited.  If you believe you
may have received this electronic message in error, please notify the sender immediately by
return email and delete or destroy the original message and/or any copy of it from your computer
system and/or your files.  Thank you. 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message