我的问题是这个线程的延续: Ant:将相同的文件集复制到多个地方
我是映射器的新手。有人(carej?)可以分享一个使用映射器执行此操作的示例吗?这是我正在尝试的:
父文件夹
|----child1_文件夹
| |----文件
| |----config.file
| |----数据.txt
|----child2_文件夹
|----child3_文件夹
.
.
.
|----childn_folder
我没有使用 ant-contrib 的选项(对不起......蚂蚁位置或任何 taskdesf 不在我的控制之下)。所以我不知道如何遍历不确定数量的文件夹。
对我的限制:
- 我只知道 child1_folder 的名字(不知道其他孩子的名字)
- 其他孩子的数量不确定
- 我应该
files在每个子文件夹下创建文件夹(通过另一个任务,如果不是复制的话)。
这是我正在尝试的(目前正在尝试单个文件,一旦开始工作,将使用额外的映射器进行扩展):
<copy todir="/tmp/parent_folder" verbose="true">
<fileset dir="/tmp/parent_folder">
<include name="*/files/config.file"/>
</fileset>
<mapper type="glob" from="*/files/config.file" to="*/files/config.file"/>
</copy>
它一直说skipped - don't know how to handle it后面跟着No sources found.。
在此先感谢, 帕拉格多克
另一个(可能?)相关问题: Using mapper & fileset to copy files into a different subdirectory?