ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Getting ":" delimeted, "flattened" list of files in a property?
Date Thu, 18 Apr 2002 17:58:33 GMT
--- Peter Villiers <Peter.Villiers@ibiomatics.com> wrote:
> Sorry for this basic question but I would like to get a list of files
> from a given directory (no path info) into a property.  The files should
> be delimted by a ":".  
>  
> For example, I have a directory c:\dir1\dir2\dir3 that contains files
> a.txt and b.txt and I want to have a property that has the value
> "a.txt:b.txt" so that I can pass it as an argument in an <exec> tag.

Try:
  <property name="dist.server.dir" location="dir2/dir3" />

  <fileset id="test.fileset" dir="${dist.server.dir}">
    <include name="*.txt" />
  </fileset>

  <target name="test">
    <pathconvert pathsep=":" refid="test.fileset"
property="test.filelist">
      <map from="${dist.server.dir}${file.separator}" to="" />
    </pathconvert>
    <echo>test.filelist = ${test.filelist}</echo>
  </target>

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message