Hello, --- Venkat Kotu <[EMAIL PROTECTED]> wrote:
> Hi, > > > > I have a situation where in I need to find all the > .jar files in a > directory and write it to a temp file. You can use a pure Ant solution using <fileset> and <pathconvert>: <fileset id="jar.files.od" dir="myDir"> <include name="*.jar"/> </fileset> <pathconvert refid="jar.files.id" property="jar.files"/> <echo file="tempfile">${jar.files}</echo> > The command from the prompt is : find myDir/*.jar > and it lists all the > .jar files from myDir directory. Wildcards are expanded by the shell and not by the unix commands. Usually the commands run with <exec> and started via java.lang.Runtime.exec() so the shell is not used, so no wildcards expansion happens. > > The ant target defined for the purpose is: > > <target name="list.jars"> > > <exec os="unix" executable="find" > outputproperty="temp.txt"> > > <arg > line="$basedir}/myDir/*.jar"/> > > </exec> > > </target> I believe it must be something like this: <exec executable="sh"> <arg line="find ${basedir}}/myDir/*.jar"/> </exec> Of course it is better to use the pure ant solution. Anyway, wildcards with <exec> is asked often (so it is a FAQ candidate) and the last time it was asked was about a week ago, so please take a look at the archives for more information. Regards Ivan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]