Skip to content

Commit e8eb4be

Browse files
author
yuanjie(qinhua)
committed
feat: support single file > 4GB
Signed-off-by: yuanjie(qinhua) <yuanjie.jyj@alibaba-inc.com>
1 parent d608e80 commit e8eb4be

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/code/helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def write_file(self, zinfo_or_arcname, file_object, compress_type=None):
109109
zinfo.file_size = file_size
110110

111111
# Write updated header info, Write CRC and file sizes after the file data
112-
fmt = '<LLLL'
112+
# <QQQQ corresponds to C language's unsigned long long, supporting a single file > 4GB.
113+
fmt = '<QQQQ'
113114
self.fp.write(struct.pack(fmt, zipfile._DD_SIGNATURE, zinfo.CRC,
114115
zinfo.compress_size, zinfo.file_size))
115116

0 commit comments

Comments
 (0)