(path string, remoteSize string)
| 123 | } |
| 124 | |
| 125 | func 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 | |
| 142 | func classifyOpenCategory(name string) string { |
| 143 | switch strings.ToLower(filepath.Ext(name)) { |