A simpler move-files patch
Dave Dykstra
dwd at bell-labs.com
Thu May 9 10:22:02 EST 2002
On Tue, May 07, 2002 at 12:13:22PM -0700, Wayne Davison wrote:
> 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.
Maybe I'm dense, but I don't see how that's any different from turning
on a flag (with the opposite meaning) at the end.
> > 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:
>
> http://www.clari.net/~wayne/rsync-delete-sent-files.patch
- Dave Dykstra
More information about the rsync
mailing list