Ahmed, Shakir wrote:
Here is the final code that worked to unzip a large file in the network
drive.

CHUNK_SIZE = 10 * 1024 * 1024


fh = open('T:\\applications\\tst\\py\\Zip_Process\\Zip\\myzip.zip',
'rb')
z = zipfile.ZipFile(fh)
for name in z.namelist():
    fn = open(name, 'wb')
    ptr = 0
    data = z.read(name)
size = len(name) print size
    print ptr
    while ptr < size:
        #fn.write(data)
        fn.write(data[ptr:ptr+CHUNK_SIZE])
        ptr += CHUNK_SIZE
    fn.close()
fh.close()

The 'size = len(name)' should be 'size = len(data)'.

~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to