A simpler move-files patch

Wayne Davison wayned at users.sourceforge.net
Tue May 7 17:16:46 EST 2002

On Tue, 7 May 2002, Dave Dykstra wrote:
> I am a little bit uncomfortable with the sense of the flag
> FLAG_NO_DELETE, though, because I'm afraid there might become more
> cases in the future where it should be set and we won't remember to
> add it.

Good point.  I've got a fix that removes this possibility.  (See below.)

> How complicated would it be if you instead turned on a
> FLAG_READ_SUCCEEDED in the case(s) where there were no errors?

Doing this changes the code back into how it was working -- namely
having it only remove sender-side files that really got info sent (since
no identical files would get this flag set).  I think I favor the new
way of also removing identical files.  For instance, I once ran my rsync
to send some files from one system to the next and I realized that I
forgot the --move-files option, so I re-ran the command with that option
and didn't notice until later that nothing whatsoever had happened
during the second transfer (since the files were all up-to-date, nothing
was deleted on the sender).

So, my current code turns on FLAG_NO_DELETE at the very beginning of the
section where we start to synchronize the file, and it only gets turned
off again at the end where things all finished properly.  In this way
any failure-case is guaranteed to have the no-delete flag set.

> Also, what do you think about the name --delete-sent-files instead of
> --move-files?

I think it accurately conveys what's happening, so I can live with it
(even though it's a bit long).

If you'd like to see the updated version of my patch, check it out here:



More information about the rsync mailing list