Debian Codegraph @

ioctl_nonlinux.go

raw
1 //go:build !linux
2 // +build !linux
3
4 package desync
5
6 import (
7 "errors"
8 "os"
9 )
10
11 func CanClone(dstFile string, srcFile string) bool {
12 return false
13 }
14
15 func CloneRange(dst, src *os.File, srcOffset, srcLength, dstOffset uint64) error {
16 return errors.New("Not available on this platform")
17 }
18
19 // GetFileSize determines the size, in Bytes, of the file located at the given
20 // fileName.
21 func GetFileSize(fileName string) (size uint64, err error) {
22 info, err := os.Stat(fileName)
23 if err != nil {
24 return 0, err
25 }
26 fm := info.Mode()
27 if isDevice(fm) {
28 // TODO we probably should do something platform specific here to get the correct size
29 }
30 return uint64(info.Size()), nil
31 }