From: Jeff Halter Date: Tue, 7 Jun 2022 23:01:46 +0000 (-0700) Subject: Exclude unsupported >4GiB files from file listings X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/commitdiff_plain/fca1ebde1d6a552ce6e4e995fc12c73450af218b Exclude unsupported >4GiB files from file listings --- diff --git a/hotline/files.go b/hotline/files.go index e77f631..d07f445 100644 --- a/hotline/files.go +++ b/hotline/files.go @@ -86,6 +86,10 @@ func getFileNameList(filePath string) (fields []Field, err error) { 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)[:])