Not sure if this is the right course of action, but take a look at the source for the <javac> task, Javac.java. In particular look at the scanDir method. I think this might be leveraged to perform what you're looking for. Unfortunately, it does not set any property, but I'm sure you can ,make it do so, or perhaps create a new task that can do this.
-----Original Message----- From: Gareth Thorburn [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 06, 2002 12:00 AM To: [EMAIL PROTECTED] Subject: How obtain the number of files in a fileset ? Hi, I'ld quite like to have a target which simply produces a count of the number of .java files in my project. Ideally, this would be a simple 'count' task which takes a fileset,patternset or something similar to the javac task and then sets a property value to the result. I'ld like then to be able to echo out some text displaying this value. The echo requirement is because I have a large build involving many subprojects and generally run ant with the -quiet option, to provide neater more compact output. I've seen previous posts which have found a solution using OS specific calls but I'm not going to go down that route. Any ideas ? Gareth -- Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>