I've got a feeling that because of a bug in the <fileset> task, I think this
wont
work easily at the moment unless its been fixed.

You should be able to use the <foreach> task (see ant-contrib on
sourceforge), the
URL of which is frequently posted on this mailing list if you search for
"ant-contrib"
and do something like the following:

<foreach param="dirname" target="deleteme">
  <fileset dir="base">
    <include name="**/CVS"/>
  </fileset>
</foreach>

<target name="deleteme">
<delete dir="${dirname}"/>
</target>

Alternatively as a hack you can copy the delete-root somewhere else, as the
defaultexcludes will not copy any CVS directories. And then copy this back
but it takes longer.

You're supposed to be able to do something like:
<delete includeEmptyDirs="true">
  <fileset dir="base">
    <include name="**/CVS"/>
  </fileset>
</delete>

However this will delete all empty directories, not just the (newly-deleted)
CVS ones, so this may or may not be applicable in your situation
Personally speaking I'd use the first method.

Hope this helps
Cheers
-Geoff





-----Original Message-----
From: Stacy Young [mailto:[EMAIL PROTECTED]]
Sent: 07 September 2002 06:34 PM
To: '[EMAIL PROTECTED]'
Subject: How to delete multiple folders by pattern?



I'm trying to delete all instances of a folder called CVS within a directory
structure but for the life of me I can't get it right...

Any help appreciated!

Stace


AVIS IMPORTANT:
-------------------------------
Les informations contenues dans le present document et ses pieces jointes
sont strictement confidentielles et reservees a l'usage de la (des)
personne(s) a qui il est adresse. Si vous n'etes pas le destinataire, soyez
avise que toute divulgation, distribution, copie, ou autre utilisation de
ces informations est strictement prohibee.  Si vous avez recu ce document
par erreur, veuillez s'il vous plait communiquer immediatement avec
l'expediteur et detruire ce document sans en faire de copie sous quelque
forme.

WARNING:
-------------------------------
The information contained in this document and attachments is confidential
and intended only for the person(s) named above.  If you are not the
intended recipient you are hereby notified that any disclosure, copying,
distribution, or any other use of the information is strictly prohibited.
If you have received this document by mistake, please notify the sender
immediately and destroy this document and attachments without making any
copy of any kind.



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to