diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-07 16:01:46 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-07 16:01:46 -0700 |
| commit | fca1ebde1d6a552ce6e4e995fc12c73450af218b (patch) | |
| tree | 132ad4131982ae27b299ce233827ede7da3aff9e /hotline/files.go | |
| parent | 40414f9295dd301f1c714bc3067392b7cc8f8427 (diff) | |
Exclude unsupported >4GiB files from file listings
Diffstat (limited to 'hotline/files.go')
| -rw-r--r-- | hotline/files.go | 4 |
1 files changed, 4 insertions, 0 deletions
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)[:]) |