-1

I need to copy a file to my machine from a remote machine. Are there any ant targets to do that?

3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by isuruj
Featured Replies
  • 1
    Ezzaral 2,714   7 Years Ago

    If you mean task instead of target, yes there is. [URL="http://ant.apache.org/manual/index.html"]Read the documentation[/URL]. Read More

0

I read the documentation, but I couldn't find a way to do that. So can sombody mention how to do that?

0

Use the 'copy' task

<project name="blank" default="copy_file">
   
    <property name="srcfile" value="\\remote_mc_name\srcdir\file.txt"/>
    <property name="destpath" value="C:\destdir"/>

    <target name="copy_file" >
      <copy
        file="${srcfile}"
        todir="${destpath}"/>
    </target>

</project>

you can use the IP address instead of the remote_mc_name for source file path

0

I needed to copy .log file. According to above code I did that. But for copying, that file or folder containing that file must be shared. It is a limitation, but I think that is only way.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.