rclone/backend/local
nielash 87ec26001f local: add server-side copy with xattrs on macOS (part-fix #1710)
Before this change, macOS-specific metadata was not preserved by rclone, even for
local-to-local transfers (it does not use the "user." prefix, nor is Mac metadata
limited to xattrs.) Additionally, rclone did not take advantage of APFS's native
"cloning" functionality for fast and deduplicated transfers.

After this change, local (on macOS only) supports "server-side copy" similarly to
other remotes, and achieves this by using (when possible) macOS's native APFS
"cloning", which is the same underlying mechanism deployed when a user
duplicates a file via the Finder UI. This has several advantages over the
previous behavior:

- It is extremely fast (even large files can be cloned instantly)
- It is very efficient in terms of storage, as it automatically deduplicates when
possible (i.e. so that having two identical files does not consume more storage
than having just one.) (The concept is similar to a "hard link", but subsequent
modifications will not affect the original file.)
- It preserves Mac-specific metadata to the maximum degree, including not only
xattrs but also metadata not easily settable by other methods, including Finder
and Spotlight params.

When server-side "clone" is not available (for example, on non-APFS volumes), it
falls back to server-side "copy" (still preserving metadata but using more disk
storage.) It is only used when both remotes are local (and not wrapped by other
remotes, such as crypt.) The behavior of local on non-mac systems is unchanged.
2024-08-15 15:36:38 +01:00
..
about_unix.go build: fix linting issues reported by running golangci-lint with different GOOS 2024-04-22 19:29:12 +02:00
about_windows.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
clone_darwin.go local: add server-side copy with xattrs on macOS (part-fix #1710) 2024-08-15 15:36:38 +01:00
fadvise_other.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
fadvise_unix.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
lchtimes_unix.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
lchtimes.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
local_internal_test.go local: disable unreliable test 2024-04-02 18:48:34 +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 encoding of root path 2024-07-15 12:10:04 +01:00
metadata_bsd.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
metadata_linux.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
metadata_other.go build: fix linting issues reported by running golangci-lint with different GOOS 2024-04-22 19:29:12 +02:00
metadata_unix.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
metadata_windows.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
metadata.go local: add Metadata support #111 2022-06-29 14:29:36 +01:00
read_device_other.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
read_device_unix.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
remove_other.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
remove_test.go Replace deprecated ioutil 2022-11-07 11:41:47 +00:00
remove_windows.go build: fix linting issues reported by golangci-lint on windows 2024-04-22 19:29:12 +02:00
setbtime_windows.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
setbtime.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
symlink_other.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
symlink.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02: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 build: fix linting issues reported by running golangci-lint with different GOOS 2024-04-22 19:29:12 +02:00
xattr.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00