All,
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. So far I have the following, which
still needs the "dir2/dir3/" stripped from it:
<!-- basedir has
the value c:\dir1-->
<property
name="dist.server.dir" value="dir2/dir3" />
<path
id="test.fileset">
<fileset dir="${basedir}\${dist.server.dir}">
<include name="*.txt" />
</fileset>
</path>
<fileset dir="${basedir}\${dist.server.dir}">
<include name="*.txt" />
</fileset>
</path>
<target
name="test">
<property name="mapfrom" value="${basedir}"/>
<pathconvert pathsep=":" refid="test.fileset" property="test.filelist">
<map from="${mapfrom}" to="" />
</pathconvert>
<echo>test.filelist: ${test.filelist}</echo>
<property name="mapfrom" value="${basedir}"/>
<pathconvert pathsep=":" refid="test.fileset" property="test.filelist">
<map from="${mapfrom}" to="" />
</pathconvert>
<echo>test.filelist: ${test.filelist}</echo>
</target>
Alternatively, is
there any way to do a string replacement on a property and create a new
one. I had seen some posts on a PROPERTYCOPY function but there is no doc
for that that I have found. I'm using ant 1.4.1.
Thanks in
advance,
Peter
Villiers
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
