MCPcopy
hub / github.com/syncthing/syncthing / copyRangeImplementationForBasicFile

Function copyRangeImplementationForBasicFile

lib/fs/basicfs_copy_range.go:15–27  ·  view source on GitHub ↗
(impl copyRangeImplementationBasicFile)

Source from the content-addressed store, hash-verified

13type copyRangeImplementationBasicFile func(src, dst basicFile, srcOffset, dstOffset, size int64) error
14
15func copyRangeImplementationForBasicFile(impl copyRangeImplementationBasicFile) copyRangeImplementation {
16 return func(src, dst File, srcOffset, dstOffset, size int64) error {
17 src = unwrap(src)
18 dst = unwrap(dst)
19 // Then see if it's basic files
20 srcFile, srcOk := src.(basicFile)
21 dstFile, dstOk := dst.(basicFile)
22 if !srcOk || !dstOk {
23 return syscall.ENOTSUP
24 }
25 return impl(srcFile, dstFile, srcOffset, dstOffset, size)
26 }
27}
28
29func withFileDescriptors(first, second basicFile, fn func(first, second uintptr) (int, error)) (int, error) {
30 fc, err := first.SyscallConn()

Callers 4

initFunction · 0.85
initFunction · 0.85
initFunction · 0.85
initFunction · 0.85

Calls 1

unwrapFunction · 0.85

Tested by

no test coverage detected