copyRangeMethodΒΆ
Added in version 1.8.0.
Provides a choice of method for copying data between files. This can be used to optimise copies on network filesystems, improve speed of large copies or clone the data using copy-on-write functionality if the underlying filesystem supports it.
The following values are accepted:
standard(default)Reads the data from source file into application memory, writes the data from application memory into the destination file. (This is the method used by Syncthing prior to this option being introduced.)
Available on: All platforms
copy_file_rangeUses the Linux
copy_file_rangesyscall which, if the underlying filesystem supports it, uses copy-on-write semantics to clone the data. Introduced in Linux 4.5 and tested on XFS and BTRFS. Some network filesystems might use this to perform server-side copies.Tested on: BTRFS, EXT4, XFS, ZFSAvailable on: LinuxioctlUses the
ioctlsyscall withFICLONERANGEoption which, if the underlying filesystem supports it, uses copy-on-write semantics to clone the data. Officially introduced in Linux 4.5, but was previously known asBTRFS_IOC_CLONE_RANGE, which was used to provide copy-on-write semantics to BTRFS filesystems since Linux 2.6.29. Some network filesystems might use this to perform server-side copies. Will fail if not supported by the underlying filesystem.Tested on: BTRFSAvailable on: LinuxsendfileUses the
sendfilesyscall which performs in-kernel copy, avoiding having to copy the data into application memory.Tested on: BTRFS, XFS, EXT4Available on: Linux, Solarisduplicate_extentsUses Windows Block Cloning via
FSCTL_DUPLICATE_EXTENTS_TO_FILE, which provides copy-on-write semantics to clone the data. Requires Windows 10 v1607 / Windows Server 2016 or later, and a compatible filesystem (ReFS, SMB 3.1.1, CsvFS). Will fail if not supported by the underlying filesystem.Tested on: ReFSAvailable on: WindowsallTries all of the copy methods in the following order:
ioctl,copy_file_range,sendfile,duplicate_extents,standard.Available on: All platforms