tags:

views:

104

answers:

1

Hi,

I have several files with name abc* and i want to delete all those files. is it possible using ant task. For eg. my directory structure is:

c:\ myapp\ abc.xml abc.txt abc-1.2.xml abc-abc.xml abcdef.xml pqr.xml xyz.xml abc\

so from this, i need to delete all abc* files. So if i use ant it should delete following: abc.xml abc.txt abc-1.2.xml abc-abc.xml abcdef.xml

it should leave directory with abc*

Can somebody help me.

Almas

+3  A: 
<target name="testingdelete" >
<delete>
    <fileset dir="." includes="**/abc*"/>
  </delete>
</target>

should work.

It deletes all files with abc* and leaves behind directories named abc. It will delete from all sub-directories as well.

JoseK
@user315228 if this solution has worked for you, please accept the answer by using the tick on the left side
JoseK