http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2515
*** shadow/2515 Mon Jul 9 07:49:13 2001 --- shadow/2515.tmp.11552 Mon Jul 9 07:49:14 2001 *************** *** 0 **** --- 1,47 ---- + +============================================================================+ + | Move Task deletes file when source and destination are identical. | + +----------------------------------------------------------------------------+ + | Bug #: 2515 Product: Ant | + | Status: NEW Version: unspecified | + | Resolution: Platform: Other | + | Severity: Minor OS/Version: Other | + | Priority: Other Component: Core tasks | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + The move task, as it is now, copies the source file to the destination and then + deletes the source. + + Two issues: + + 1. Copying is done even when the canonical file names are identical. This + mustn't be done. + 2. Deletion is performed unconditionally resulting in deletion of the + destination file (which happens to be the same as the source, in this case). + + In contrast, the copy task checks to see if the source and destination file + names are the same and then skips copying it if they are. + + The Move task should either skip over the file quietly (as Ren does in Windows) + or fail out saying the source and destination files are identical (as mv does + in Unix) + + I am marking it as a minor issue as I don't think users would be performing + moves where the source and destination are the same. But still, users will be + users... + + Sample: + + Assuming file f1 is already in /export/home/mumasank, execution of the + following task results in f1 being deleted. + + <target name="move2samefile"> + <move file="f1" tofile="../../home/mumasank/f1"/> + </target> + + Magesh
