MCPcopy Create free account
hub / github.com/52funny/pikpakcli / localFileMatchesRemoteSize

Function localFileMatchesRemoteSize

internal/shell/open.go:125–140  ·  view source on GitHub ↗
(path string, remoteSize string)

Source from the content-addressed store, hash-verified

123}
124
125func localFileMatchesRemoteSize(path string, remoteSize string) (bool, error) {
126 expectedSize, err := strconv.ParseInt(remoteSize, 10, 64)
127 if err != nil || expectedSize < 0 {
128 return false, nil
129 }
130
131 info, err := os.Stat(path)
132 if err != nil {
133 if os.IsNotExist(err) {
134 return false, nil
135 }
136 return false, err
137 }
138
139 return info.Size() == expectedSize, nil
140}
141
142func classifyOpenCategory(name string) string {
143 switch strings.ToLower(filepath.Ext(name)) {

Callers 1

cacheOpenFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected