This works for me with Ant 1.7.0. What version are you using? Brian
-----Original Message----- From: Hariharasudhan R [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 15, 2008 11:41 AM To: Ant Users List Subject: Re: Is there a way to search for a file matching a condition and assign it to a variable ? Hi Brian, Unfortunately that did not work. pathconvert does not take a nested fileset . thanks, Hari On Jan 16, 2008 12:54 AM, Brian Bassett <[EMAIL PROTECTED]> wrote: > I'd take a look at <pathconvert>, probably something like this: > > <pathconvert property="my_variable"> > <fileset dir="C:\mydir" includes="commons-io-*.jar" /> > </pathconvert> > > Brian > > -----Original Message----- > From: Hariharasudhan R [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 15, 2008 11:15 AM > To: Ant Users List > Subject: Is there a way to search for a file matching a condition and > assign > it to a variable ? > > Hi experts! > > Is there a way to search for a file matching a condition and assign it to > a > variable ? > > Basically I want something like : > > <task dir="c:\mydir" filter="commons-io-*.jar" > output_variable="my_variable" > /> > > my_variable should contain the list of jar files in C:\mydir that match > the > pattern "commons-io-*.jar". > > In my project, since C:\mydir will contain only one file matching > commons-io-*.jar my_variable will effectively contain only one file name. > > My actual requirement : > copy the commons io jar ( now commons-io-1.3.2.jar ) to commons-io.jar. > The jar may get updated over time with the newer version of commons io, > but > i should not need to have to change the ant build.xml. > I thought I could get this done if I managed to capture the name of the > commons-io-*.jar in a variable and passed it as a parameter to <copy> > task. > > Is there a way to accomplish this ? > Any pointers is greatly appreciated. > > thanks in advance, > Hari > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]