【问题标题】:How to copy file to a directory which has partial fixed name and other half changes with integer values. using ant script如何将文件复制到具有部分固定名称和另一半更改为整数值的目录。使用蚂蚁脚本
【发布时间】:2015-11-30 18:33:59
【问题描述】:

我想使用 ant 脚本将文件复制到路径不固定但最后一个文件夹名称不固定的目录。 路径 D:\Home\Config\plugins\1780。 最后一个文件夹名称(1780)它随机更改并且不固定。 我想将战争文件复制到该文件夹​​中。 我该怎么做。

谢谢, 普拉尚特

【问题讨论】:

  • 随机是什么意思?文件夹名称是否有标准格式?这个文件夹的可能值是什么?

标签: ant


【解决方案1】:

您应该(一次)遍历 plugins 子目录并复制到(仅?)条目。

<target name="run">
   <foreach target="loop" param="loop.param">
      <dirset dir="D:\Home\Config\plugins" />
   </foreach>
</target>
<target name="loop">
   <copy todir="$loop.param">
   ...
   </copy>
</target>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-07
    • 1970-01-01
    • 2019-07-26
    • 2017-12-11
    • 2015-06-12
    • 1970-01-01
    相关资源
    最近更新 更多