You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mohit Anchlia <mo...@gmail.com> on 2008/10/15 18:50:35 UTC

copy directory

Does below copy the files along with directory?

       <copy todir="${dir}">
            <fileset dir="${tools.dir}/install/**">
            <fileset dir="${tools.dir}/st/*">

What's the difference between ** and just *? Would first one copy
along with directory and the second one only individual files?

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


Re: copy directory

Posted by Mohit Anchlia <mo...@gmail.com>.
Thanks.

So if I say my/dir/** then "dir" is recursively copied to the
destination and when I say my/dir/* then only files under dir are
copied to the destination but not the "dir" itself.

I'll try it out.

On Wed, Oct 15, 2008 at 10:39 PM,  <Ja...@rzf.fin-nrw.de> wrote:
> ** is a deep copy. All nested directories are copied too.
> *  copies all files in that directory.
> After a trailing slash is automatically a ** added.
>
> my/dir/*.txt  --> copies my/dir/a.txt, my/dir/b.txt, ...
> my/**/*.txt   --> copies all text files somewhere under 'my'
> my/**         --> copies all files under 'my'
> my/           --> same as my/**
>
> http://ant.apache.org/manual/CoreTypes/patternset.html
>
>
> Jan
>
>>-----Ursprüngliche Nachricht-----
>>Von: Mohit Anchlia [mailto:mohitanchlia@gmail.com]
>>Gesendet: Mittwoch, 15. Oktober 2008 18:51
>>An: Ant Users List
>>Betreff: copy directory
>>
>>Does below copy the files along with directory?
>>
>>       <copy todir="${dir}">
>>            <fileset dir="${tools.dir}/install/**">
>>            <fileset dir="${tools.dir}/st/*">
>>
>>What's the difference between ** and just *? Would first one copy
>>along with directory and the second one only individual files?
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


AW: copy directory

Posted by Ja...@rzf.fin-nrw.de.
** is a deep copy. All nested directories are copied too.
*  copies all files in that directory.
After a trailing slash is automatically a ** added.

my/dir/*.txt  --> copies my/dir/a.txt, my/dir/b.txt, ...
my/**/*.txt   --> copies all text files somewhere under 'my'
my/**         --> copies all files under 'my'
my/           --> same as my/**

http://ant.apache.org/manual/CoreTypes/patternset.html


Jan 

>-----Ursprüngliche Nachricht-----
>Von: Mohit Anchlia [mailto:mohitanchlia@gmail.com] 
>Gesendet: Mittwoch, 15. Oktober 2008 18:51
>An: Ant Users List
>Betreff: copy directory
>
>Does below copy the files along with directory?
>
>       <copy todir="${dir}">
>            <fileset dir="${tools.dir}/install/**">
>            <fileset dir="${tools.dir}/st/*">
>
>What's the difference between ** and just *? Would first one copy
>along with directory and the second one only individual files?
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>

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