mirror of
https://github.com/rclone/rclone.git
synced 2025-08-14 15:58:26 +02:00
dropbox: make setting mod time on existing files work properly
This is a fix left over from the v2 conversion. Dropbox ignores the client modification on an incoming file if it was identical to the existing file. This change deletes the existing file first before re-uploading the new one.
This commit is contained in:
@ -183,7 +183,14 @@ func equal(src, dst Object, sizeOnly, checkSum bool) bool {
|
||||
// mtime of the dst object here
|
||||
err := dst.SetModTime(srcModTime)
|
||||
if err == ErrorCantSetModTime {
|
||||
Debugf(src, "src and dst identical but can't set mod time without re-uploading")
|
||||
Debugf(dst, "src and dst identical but can't set mod time without re-uploading")
|
||||
return false
|
||||
} else if err == ErrorCantSetModTimeWithoutDelete {
|
||||
Debugf(dst, "src and dst identical but can't set mod time without deleting and re-uploading")
|
||||
err = dst.Remove()
|
||||
if err != nil {
|
||||
Errorf(dst, "failed to delete before re-upload: %v", err)
|
||||
}
|
||||
return false
|
||||
} else if err != nil {
|
||||
Stats.Error()
|
||||
|
Reference in New Issue
Block a user