Is there any command in ant to copy files from one folder structure to another without checking the last modified date/time overwriting files. Basically I want all extra files from folder A to folder B. That is: no files of folder B are replaced but extra files of folder A comes to folder B.
我看到“ant copy”和“ant move”命令,但没有帮助。有什么建议。
Ant的复制任务的overwrite属性指出:
“即使目标文件较新,也会覆盖现有文件。”
因此,将其设置为 false 只会防止它们在较新的情况下被覆盖,但如果原始文件较新,则无论如何它们都会被覆盖。
我发现解决这个问题的唯一方法是在复制之前触摸目标文件,即:
<touch>
<fileset dir="${dest.dir}"/>
</touch>
<copy todir="${dest.dir}" overwrite="false">
<fileset dir="${src.dir}"/>
</copy>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)