Ant :将文件移动到目标目录



我正在尝试将文件测试.txt从文件所在的基目录移动到"输出"目标文件夹中。除了将文件test复制到所需的目录.txt并从最初创建文件的基目录中删除文件test.txt之外,还有其他方法吗?另外,请建议是否有任何替代方法可以使用echo标签来创建文件。

<target name="output">
    <checksum file="${fileName}" property="md5"/>
    <echo file="test.txt" append="true" message="${fileName} - ${md5}">${line.separator}</echo>
    <copy file="test.txt" todir="output"/>
    <delete file="test.txt" />
</target>
您可以使用

以下命令移动文件

<move file="a.txt" todir="Dir" />

<move todir="Dir"> <fileset dir="SourceDir/" /> </move >

相关内容