From fca1ebde1d6a552ce6e4e995fc12c73450af218b Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Tue, 7 Jun 2022 16:01:46 -0700 Subject: Exclude unsupported >4GiB files from file listings --- hotline/files.go | 4 ++++ 1 file changed, 4 insertions(+) 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)[:]) -- cgit