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

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

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

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.