Ravi
Ravi

Reputation: 3210

Ant : moving a file into a target directory

I am trying to move the file test.txt into the 'output' target folder from the base directory where the file exists. Is there any other way other than copying the file test.txt to the required directory and deleting the file test.txt from the base directory, where it has been originally created. Also please suggest if there is any alternative to use echo tag to create the file.

<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>

Upvotes: 0

Views: 2621

Answers (1)

Prashant
Prashant

Reputation: 2614

You can use below command to move file

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

or

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

Upvotes: 5

Related Questions