[ZIPfile] zip de fichier supperieur a 2 gig
Bonjour,
Je me retrouve face a une limitation de la librairie zipfile.
La structure de zinfo limite la taille d'un fichier a la taille d'un int a savoir ZIP64_LIMIT ( egale a "(1 << 31) - 1" donc à 2147483647)
Le problème est notamment ici :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
# Here are some struct module formats for reading headers
structEndArchive = "<4s4H2lH" # 9 items, end of archive, 22 bytes
stringEndArchive = "PK\005\006" # magic number for end of archive record
structCentralDir = "<4s4B4HlLL5HLl"# 19 items, central directory, 46 bytes
stringCentralDir = "PK\001\002" # magic number for central directory
structFileHeader = "<4s2B4HlLL2H" # 12 items, file header record, 30 bytes
stringFileHeader = "PK\003\004" # magic number for file header
structEndArchive64Locator = "<4slql" # 4 items, locate Zip64 header, 20 bytes
stringEndArchive64Locator = "PK\x06\x07" # magic token for locator header
structEndArchive64 = "<4sqhhllqqqq" # 10 items, end of archive (Zip64), 56 bytes
stringEndArchive64 = "PK\x06\x06" # magic token for Zip64 header |
et donc ici aussi :
Code:
1 2 3
|
self.fp.write(struct.pack("<lLL", zinfo.CRC, zinfo.compress_size,
zinfo.file_size)) |
La taille des fichier zippé est limité par la taille d'un int dans zinfo.file_size.
Pour mon cas je dois faire des zips de fichier de 8 GIG.
Donc soit je contourne le problème en faisant un split de zip (je ne sais pas encore comment faire ca avec zipfile) ou bien j'utilise un outil tier comme 7zip.
Est ce que qq aurais une autre idée ?