ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pascal Quesseveur" <>
Subject Re: selecting empty directories
Date Wed, 20 Dec 2006 13:40:42 GMT
paul.arzul writes (2006-12-20, 14:05:24):

>how do you select empty directories/folders? (a directory which has no files or
>folders in it?)

The following code uses <for> and <if> target from ant-contrib to list
empty dirs under project.dir:

    <for param="dir" >
      <dirset dir="${project.dir}" />
        <pathconvert property="@{dir}.list" setonempty="no" >
            <fileset dir="@{dir}" defaultexcludes="yes" />
        <if><not><isset property="@{dir}.list" /></not>
            <echo message="@{dir} is empty" />

I set defaultexcludes to yes in the fileset spec to list empty dirs and dirs
containing only trash files.


Pascal Quesseveur,

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

View raw message