copy all files from one directory and subdirectori

2019-04-11 18:08发布

Hi all please help ASAP...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

标签: ant
1条回答
贪生不怕死
2楼-- · 2019-04-11 18:38

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>
查看更多
登录 后发表回答