Copy command for ant Learning

Source: Internet
Author: User

<?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 command
Copy is mainly used to copy files and directories. Example:
Eg1. copy a single file:
<Copy file = "original.txt" tofile = "copied.txt"/>
Eg2. copy the file directory:
<Copy todir = "../dest_dir">
<Fileset dir = "src_dir"/>
</Copy>
Eg3. copy the file to another directory:
<Copy file = "source.txt" todir = "../home/philander"/>
-->

Copy command for ant Learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.