> From: Thomas Haas [mailto:[EMAIL PROTECTED] > In our build we need to rename files, so here is the missing > rename task > (using Copyfile as template, tnx [EMAIL PROTECTED]): > > <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.
+1 for me. When this is added, we have all basic file operations: Delete, Copy and Rename. Although I like to have the same syntax & behaviour as copyfile: only replace when newer (so no replace attribute). > 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" /> The rationale behind the implicit check for newer files, is that in 99.9% of all cases you don't want to copy a file again, when it is there already. A check on the date is a pretty good indicator that a file has not been changed. When rebuilding your project, this can save a huge amount of time. Only in exceptional cases you want to overwrite a file with an older one. In these rare situations, you can better use a delete in combination with a copyfile. I like the way it is done now. My 2 cents, Arnout
