2015-04-23 25 views
8

Çıktı dosyalarını sıkıştıran bir komut dosyası var. Sorun, dosyalardan birinin 4Gigs üzerinde olmasıdır. Komut dosyasını standart zip yerine ZIP64 uzantılarını kullanmaya nasıl dönüştürürüm? İşteBüyük dosyaları sıkıştırırken ZIP64 uzantılarını kullanan Python

Şu anda sıkıştırma am nasıl:

try: 
    import zlib 
    compression = zipfile.ZIP_DEFLATED 
except: 
    compression = zipfile.ZIP_STORED 

modes = { zipfile.ZIP_DEFLATED: 'deflated', 
      zipfile.ZIP_STORED: 'stored', 
      } 

compressed_name = 'edw_files_' + datetime.strftime(date(), '%Y%m%d') + '.zip' 
print 'creating archive' 
zf = zipfile.ZipFile('edw_files_' + datetime.strftime(date(), '%Y%m%d') + '.zip', mode='w') 
try: 
    zf.write(name1, compress_type=compression) 
    zf.write(name2, compress_type=compression) 
    zf.write(name3, compress_type=compression) 
finally: 
    print 'closing' 
    zf.close() 

teşekkürler! Bill Bunun gibi

cevap

5

:

zf = zipfile.ZipFile('edw_files_' + datetime.strftime(date(), '%Y%m%d') + '.zip', mode='w', allowZip64=True) 
12

atın zipfile-objects.

Bunu yapabilirsin:

zf = zipfile.ZipFile('edw_files_' + datetime.strftime(date(), '%Y%m%d') + '.zip', mode='w', allowZip64 = True) 
İlgili konular