"strings"
)
+const incompleteFileSuffix = ".incomplete"
+
func downcaseFileExtension(filename string) string {
splitStr := strings.Split(filename, ".")
ext := strings.ToLower(
}
rFile, err := os.Stat(filePath + "/" + resolvedPath)
+ if errors.Is(err, os.ErrNotExist) {
+ continue
+ }
if err != nil {
return fields, err
}
copy(fnwi.Type[:], []byte("fldr")[:])
copy(fnwi.Creator[:], fileCreator[:])
} else {
+ // the Hotline protocol does not support file sizes > 4GiB due to the 4 byte field size, so skip them
+ if file.Size() > 4294967296 {
+ continue
+ }
binary.BigEndian.PutUint32(fnwi.FileSize[:], uint32(file.Size()))
copy(fnwi.Type[:], []byte(fileTypeFromFilename(file.Name()).TypeCode)[:])
copy(fnwi.Creator[:], []byte(fileTypeFromFilename(file.Name()).CreatorCode)[:])
return bytes
}
-const incompleteFileSuffix = ".incomplete"
-
// effectiveFile wraps os.Open to check for the presence of a partial file transfer as a fallback
func effectiveFile(filePath string) (*os.File, error) {
file, err := os.Open(filePath)