rclone/backend/local
Nick Craig-Wood 5b0f9dc4e3 local: fix copying from Windows Volume Shadows
For some files the Windows Volume Shadow Service (VSS) advertises the
file size as X in the directory listing but returns a different number
Y on stat-ing the file. If the file is opened and read there are Y
bytes available for reading.

Existing copy tools copy Y bytes rather than X so for consistency
rclone should do the same.

This fixes the problem by stat-ing the file immediately before opening
it. This will also reduce the unnecessary occurrence of "can't copy -
source file is being updated" errors; if the file has finished
changing by the time we come to copy it then we now can copy it
successfully.

See: https://forum.rclone.org/t/consistently-getting-corrupted-on-transfer-sizes-differ-syncing-to-an-smb-share/42218/
2023-10-19 16:38:10 +01:00
..
about_unix.go Remove github.com/pkg/errors and replace with std library version 2021-11-07 11:53:30 +00:00
about_windows.go Fix lint issues reported by staticcheck 2022-06-13 21:13:50 +02:00
fadvise_other.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
fadvise_unix.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
lchtimes_unix.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
lchtimes.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
local_internal_test.go operations: fix .rclonelink files not being converted back to symlinks 2023-07-10 14:30:59 +01:00
local_test.go backend: allow wrapping backend tests to run in make quicktest 2022-06-29 17:30:37 +01:00
local.go local: fix copying from Windows Volume Shadows 2023-10-19 16:38:10 +01:00
metadata_bsd.go local: add Metadata support #111 2022-06-29 14:29:36 +01:00
metadata_linux.go local: fix crash with --metadata on Android 2023-05-17 17:03:26 +01:00
metadata_other.go local: add Metadata support #111 2022-06-29 14:29:36 +01:00
metadata_unix.go local: add Metadata support #111 2022-06-29 14:29:36 +01:00
metadata_windows.go local: add Metadata support #111 2022-06-29 14:29:36 +01:00
metadata.go local: add Metadata support #111 2022-06-29 14:29:36 +01:00
read_device_other.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
read_device_unix.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
remove_other.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
remove_test.go Replace deprecated ioutil 2022-11-07 11:41:47 +00:00
remove_windows.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
setbtime_windows.go all: fix spelling across the project 2022-08-30 11:16:26 +02:00
setbtime.go all: fix spelling across the project 2022-08-30 11:16:26 +02:00
symlink_other.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
symlink.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
tests_test.go local: refactor default os encoding out from local backend into shared encoder lib 2021-08-19 20:14:50 +02:00
xattr_unsupported.go local: add Metadata support #111 2022-06-29 14:29:36 +01:00
xattr.go local: use atomic types 2023-08-22 12:52:13 +01:00