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