首页 > 代码库 > ant学习之copy命令
ant学习之copy命令
<?xml version="1.0" ?><project name="antCopy" default="target1" basedir="../"> <property name="srcFile" value="E:/workspace/AntDemo/ant/test/test01/1.txt"> </property> <property name="destFile" value="E:/workspace/AntDemo/ant/test/test02/3.txt"> </property> <property name="descDir" value="E:/workspace/AntDemo/ant/test/test02" /> <property name="destDir" value="E:/workspace/AntDemo/ant/test/test03" /> <target name="target1"> <echo message=" ant copy from ${srcFile} to ${destFile}" /> <copy file="${srcFile}" tofile="${destFile}"> </copy> <copy file="${srcFile}" todir="${descDir}" /> <copy todir="${destDir}"> <fileset dir="E:/workspace/AntDemo/ant/test/test02"></fileset> </copy> </target></project>
<!--
copy 命令
copy主要用来对文件和目录的复制功能。举例如下:
eg1. 复制单个文件:
<copy file="original.txt" tofile="copied.txt"/>
eg2. 对文件目录进行复制:
<copy todir="../dest_dir">
<fileset dir="src_dir"/>
</copy>
eg3. 将文件复制到另外的目录:
<copy file="source.txt" todir="../home/philander"/>
-->
ant学习之copy命令
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。