ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject RE: How can one copy paths in a property somewhere?
Date Thu, 13 Dec 2001 19:46:44 GMT
--- Hannes van der Merwe <> wrote:
> How would you do that exactly, because there is nothing involving
> properties in the documentation under the copy target?

Sorry -- I guess that reply was a bit vague (yesterday was a bit

I meant: Reference the (comma-separated list) property in the <fileset>
element for the <copy> task. For example:

  <property name="FILES" value="a.dat:b.dat:c.dat"/>

  <target name="doCopy">
    <pathconvert pathsep="," property="FILES.list">
        <pathelement path="${FILES}"/>
      <map from="${basedir}${file.separator}" to=""/>
    <copy todir="tmp">
      <fileset dir="." includes="${FILES.list}"/>

The pathsep="," converts the colons to commas, and the <map> turns the
files back into their simple filenames, which is necessary because a)
<path> turns them into full-path filenames, and b) <fileset> can't handle
full-path filenames (not sure why <copy> doesn't allow a list of names
instead of insisting on either one file in the "file" attr or a set of
files derived via <fileset>, since that seems oddly limiting to me -- but
I suspect if I complained about it, someone would just tell me to fix it,
so you didn't hear if from me :)



Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at
or bid at

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message