Copying a file on itself empties it
The COPY and COPYRENAME tasks behave badly when a file is copied on itself.
During the copy operation, the destination file is opened in TRUNCATE mode (this is so that in case the destination file already exist, it is overwritten). But if the destination and source file are the same, that TRUNCATE removes all the source file's content, leaving it empty. After that, the copy operation immediately ends without error, since the source file is empty (so there is nothing to copy).
The COPY and COPYRENAME tasks should thus be changed to do nothing when the source and destination paths are identical.