5
我已经使用蚂蚁近十年了,但每隔一段时间我都需要做一些超出我平常经历的事情。这其中缺乏一个明显的答案(和直观的方式导致死角)一次性复制多个目录(和内容)
问题:在目录“榜样”新目录“将myInstance”
复制几个子目录(及其内容)。为了澄清,复制源目录中的一些子目录,但不是所有的子目录。
源目录:
example/
ignoreThisDirectory/
ignoreThisOneAlso/
lib
etc/
webapps/
尝试:穷途末路 这种尝试在第一次出现工作。它创建了子目录lib等,webapps。然而,“复制”并未复制其内容;我留下了空的子目录。
<copy todir="myInstance" >
<dirset dir="example" includes="lib etc webapps"/>
</copy>
成功,但冗长 最后,我不得不每个目录逐个复制,冗长和非干这似乎:
<copy todir="myInstance/etc">
<fileset dir="example/etc"/>
</copy>
<copy todir="myInstance/lib">
<fileset dir="example/lib" />
</copy>
<copy todir="myInstance/webapps">
<fileset dir="example/webapps" />
</copy>
在此先感谢
我会改为使用includes来列出要复制的内容。 – JasonMArcher 2010-11-21 06:33:03