You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Thomas Haas <ha...@softwired.ch> on 2000/02/22 20:15:13 UTC

[PATCH]: new task: rename a file

Hi

In our build we need to rename files, so here is the missing rename task
(using Copyfile as template, tnx duncan@x180.com):

<rename src="path/to/old.file" dest="path/to/new.file" replace="yes|no"
/>

The file path/to/old.file is renamed to path/to/new.file.
If src already exists and replace is true, the file is deleted first.
If dst already exists and replace is false, the build halts.


Copyfile does not copy files, if the destination is newer than the
source. I was a little bit surprised of this non obvious implicit
behaviour of Copyfile. I would like to understand the rational behind
the feature and ask, if it can be turned into an option. Of course I
would like to have the feature turned of by default, but I am biased on
this. Copyfile would look like this:

<copyfile src="path/to/old.file" dest="path/to/new.file"
filtering="yes|no" skipnewer="yes|no"  />

Thanks
- tom