mirror of
https://github.com/rclone/rclone.git
synced 2024-12-21 11:06:55 +08:00
f980f230c5
Before this change, if a file was created on a remote but deleted externally from that remote then there was potential for the delete to never be noticed. The sequence of events was: - Create file on VFS - creates virtual directory entry - File deleted externally to remote before the directory refreshed - Now the file has a virtual add but is not in the listings so will never disappear This patch fixes it by removing all virtual directory entries except the following when the directory is re-read. - On remotes which can't have empty directories: virtual directory adds are not flushed. These will remain virtual as long as the directory is empty. - For virtual file add: files that are in the process of being uploaded are not flushed This patch also adds the distinction between virtually added files and directories. It also refactors the virtual directory logic to make it easier to follow. Fixes #4446
27 lines
632 B
Go
27 lines
632 B
Go
// Code generated by "stringer -type=vState"; DO NOT EDIT.
|
|
|
|
package vfs
|
|
|
|
import "strconv"
|
|
|
|
func _() {
|
|
// An "invalid array index" compiler error signifies that the constant values have changed.
|
|
// Re-run the stringer command to generate them again.
|
|
var x [1]struct{}
|
|
_ = x[vOK-0]
|
|
_ = x[vAddFile-1]
|
|
_ = x[vAddDir-2]
|
|
_ = x[vDel-3]
|
|
}
|
|
|
|
const _vState_name = "vOKvAddFilevAddDirvDel"
|
|
|
|
var _vState_index = [...]uint8{0, 3, 11, 18, 22}
|
|
|
|
func (i vState) String() string {
|
|
if i >= vState(len(_vState_index)-1) {
|
|
return "vState(" + strconv.FormatInt(int64(i), 10) + ")"
|
|
}
|
|
return _vState_name[_vState_index[i]:_vState_index[i+1]]
|
|
}
|