I think this might help:

http://ant.apache.org/manual/CoreTasks/resourcecount.html

Here's a snippet I just tested:

        <resourcecount property="count.jars">
            <fileset dir="${jar.dir}">
                <include name="*.jar"/>
            </fileset>
        </resourcecount>
        <echo message="There are ${count.jars} jarfiles in ${jar.dir}"/>

It's much cleaner than attempting to write a script.




On 10/26/07, Sujie <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I would like to count the number of jar files in a directory.
> I am using ANT 1.7.
>
> Any help will be much appreciated.
>
> Thanks
>
> --
> View this message in context: 
> http://www.nabble.com/Ant-task-to-Count-number-of-files-in-a-directory-tf4695926.html#a13423035
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
--
David Weintraub
[EMAIL PROTECTED]

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

Reply via email to