Bug 61334 - Un-deprecate "Rename" task
Summary: Un-deprecate "Rename" task
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.10.1
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-24 20:12 UTC by Jonas Feigl
Modified: 2017-12-09 04:50 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?