ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Cryder" <christi...@granitepeaks.com>
Subject RE: Question about copying files
Date Mon, 26 Aug 2002 21:12:31 GMT
Thanks to both Jake and Dominique for their help on this. Here's the
solution (requires Ant 1.5):

        <copy todir="${build.dir}" >
            <fileset dir="${build.dir}">
                <present present="srconly" targetdir="${build.dir}">
                    <mapper type="glob" from="sample.*" to="*" />
                </present>
            </fileset>
            <mapper type="glob" from="sample.*" to="*" />
        </copy>

Christian
----------------------------------------------
Christian Cryder [christianc@atmreports.com]
Internet Architect, ATMReports.com
Barracuda - http://barracuda.enhydra.org
----------------------------------------------
"Coffee? I could quit anytime, just not today"


> -----Original Message-----
> From: Dominique Devienne [mailto:DDevienne@lgc.com]
> Sent: Monday, August 26, 2002 11:12 AM
> To: 'Ant Users List'
> Subject: RE: Question about copying files
>
>
> I believe this can be achieved by clever use of the new <selectors>
> sub-elements of <fileset>. Check it out in the doc. --DD
>
> -----Original Message-----
> From: Christian Cryder [mailto:christianc@granitepeaks.com]
> Sent: Monday, August 26, 2002 10:04 AM
> To: Ant-User
> Subject: Question about copying files
>
> Hi folks,
>
> I need to copy sample files sometimes, and I currently do it like this:
>
>     <copy todir="${build.dir}" >
>         <fileset dir="${build.dir}" />
>         <mapper type="glob" from="sample.*" to="*" />
>     </copy>
>
> What I need to know how to do, is to only copy files that _do not already
> exist_.
>
> In other words, if I have the following files in a directory:
>
>   sample.foo1 (unchanged, foo1 exists)
>   sample.foo2 (changed, foo2 exists)
>   sample.foo3 (new, foo3 does not exist)
>
> only foo3 should be copied.
>
> Suggestions?
>
> tia,
> Christian
> ----------------------------------------------
> Christian Cryder [christianc@atmreports.com]
> Internet Architect, ATMReports.com
> Barracuda - http://barracuda.enhydra.org
> ----------------------------------------------
> "Coffee? I could quit anytime, just not today"
>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:ant-user-help@jakarta.apache.org>


--
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