MCPcopy
hub / github.com/git-lfs/git-lfs / FileExistsOfSize

Function FileExistsOfSize

tools/filetools.go:46–54  ·  view source on GitHub ↗

FileExistsOfSize determines if a file exists and is of a specific size.

(path string, sz int64)

Source from the content-addressed store, hash-verified

44
45// FileExistsOfSize determines if a file exists and is of a specific size.
46func FileExistsOfSize(path string, sz int64) bool {
47 fi, err := os.Stat(path)
48
49 if err != nil {
50 return false
51 }
52
53 return !fi.IsDir() && fi.Size() == sz
54}
55
56// ResolveSymlinks ensures that if the path supplied is a symlink, it is
57// resolved to the actual concrete path

Callers 2

LinkOrCopyFromReferenceFunction · 0.92
ObjectExistsMethod · 0.92

Calls 1

SizeMethod · 0.80

Tested by

no test coverage detected