Copy all files from one directory and subdirectories into single location

ant

Solution

From what you've written maybe you want to flatten the files?

http://ant.apache.org/manual/Tasks/copy.html

<copy todir="../new/dir" flatten="true">
    <fileset dir="C:/build/build">
        <include name="**/*.txt"/>
    </fileset>
</copy>

Problem

Here is my code for copying all .txt files from one location to other: ``` <copy todir="../new/dir"> <fileset dir="C:/build/build"> <include name="**/*.txt"/> </fileset> </copy> ``` Altough it is working fine, it is copying files correctly but the problem is that it is maintainig the directory structure for non-empty directories at destination also, I want all the files under "C:/build/build" and its sub-directories shoul

Original source