复制文件时蚂蚁重命名 [英] Ant renaming while copying file

查看:28
本文介绍了复制文件时蚂蚁重命名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在将文件复制到 ant 目录时重命名文件?

How to rename file while copying it to directory in ant?

<copy file="..." todir="..." overwrite="true">

推荐答案

使用 tofile 选项代替 todir

已添加

或者来自 Ant Copy Task 文档的更复杂的例子:

Or a more complex example from Ant Copy Task documentation:

将一组文件复制到一个目录中,将 .bak 附加到文件名上苍蝇

Copy a set of files to a directory, appending .bak to the file name on the fly

  <copy todir="../backup/dir">
    <fileset dir="src_dir"/>
    <globmapper from="*" to="*.bak"/>
 </copy>

这篇关于复制文件时蚂蚁重命名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆