Bug 61334

Summary: Un-deprecate "Rename" task
Product: Ant Reporter: Jonas Feigl <jonas.feigl>
Component: Core tasksAssignee: Ant Notifications List <notifications>
Status: NEW ---    
Severity: enhancement    
Priority: P2    
Version: 1.10.1   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Jonas Feigl 2017-07-24 20:12:05 UTC
According to the ant manual the "Rename" task has been deprecated and the "Move" task should be used instead.

In our ant script we need to rename a folder where files inside the folder can be locked by a third party. If that is the case we need the whole ant script to fail.

When using the Move task to rename a folder where files inside the folder are currently being locked by a 3rd party the move task will move all files up to the point where the locked files can't be moved and the the task fails. This leaves the folder(s) in an inconsistent state. A proper rename should either work or fail as a whole and not move parts of the folder.

Therefore the Rename task should not be deprecated as this requirement cannot be implemented otherwise. (Or can it?)
Comment 1 Jaikiran Pai 2017-12-09 04:50:33 UTC
>> When using the Move task to rename a folder where files inside the folder are currently being locked by a 3rd party the move task will move all files up to the point where the locked files can't be moved and the the task fails.

As far as I know, "mv" is an atomic operation and if it does fail then I would expect the original directories to be in a proper state. Do you have an example build file which shows the usage of this task and the logs and the inconsistent state it ends up in when it fails?