ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Vaughn <gvau...@delphis.com>
Subject Deleting directories with wildcards
Date Wed, 30 May 2001 21:40:51 GMT
I have a situation where I have directories like this:

base:
  HR1:
    <bunch of subdirs and files>
  HR2:
    <bunch of subdirs and files>
  HR3:
    <bunch of subdirs and files>
  X1:
    <bunch of subdirs and files>
  X2:
    <bunch of subdirs and files>
  file1.txt
  file2.txt

I want to delete all directory trees except base/X* and *.txt so that I
end up with:

base:
  X1:
    <bunch of subdirs and files>
  X2:
    <bunch of subdirs and files>
  file1.txt
  file2.txt


I've tried:
    <target name="clean">
        <delete includeEmptyDirs="true" >
            <fileset dir="base">
                <exclude name="X*/"/>
                <exclude name="*.txt"/>
            </fileset>
        </delete>
    </target>

but this only deletes the files under base/HR* leaving the whole
directory tree intact. I thought the includeEmptyDirs would delete the
empty directories too, but it's not working.

Can someone help?

Greg Vaughn
Sr. Consultant
Delphi Consultants, LLC
gvaughn@delphis.com

Mime
View raw message