Re: unzip problem - solved

2011-06-24 Thread Ethan Furman
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

RE: unzip problem - solved

2011-06-24 Thread Ahmed, Shakir
-Original Message- From: Ethan Furman [mailto:et...@stoneleaf.us] Sent: Friday, June 24, 2011 3:47 PM To: Ahmed, Shakir Cc: Python Subject: Re: unzip problem Ahmed, Shakir wrote: > Thanks once again and you are right I am trying to unzip in the network > share drive. here is the

Re: unzip problem

2011-06-24 Thread Ethan Furman
Ahmed, Shakir wrote: Thanks once again and you are right I am trying to unzip in the network share drive. here is the script now: If I am doing any wrong. : ## code start here import zipfile import os import time dir1 = "T:\\applications\\tst\\py\\Zip_Process" test = '%s/shp'%dir1 os.chdir(test)

Re: unzip problem

2011-06-24 Thread Ethan Furman
Ahmed, Shakir wrote: Thanks for your help and really appreciate your time. I changed the code as you mentioned and here it is: fn = open('T:\\applications\\tst\\py\\Zip_Process\\Zip\\myzip.zip', 'rb') z = zipfile.ZipFile(fn) for name in z.namelist(): data = z.read(name) ptr = 0

RE: unzip problem

2011-06-24 Thread steve+comp . lang . python
Ahmed, Shakir wrote: > The problem is happening when it is coming to write option. > > The * is not the real name of the zip file, I just hide the name. Please don't waste our time by showing us fake code that doesn't do what you say it does. You said that "The script is here", but that was not

Re: unzip problem

2011-06-24 Thread Ethan Furman
Ahmed, Shakir wrote: Hi, I am getting following error message while unziping a .zip file. Any help or idea is highly appreciated. Error message>>> Traceback (most recent call last): File "C:\Zip_Process\py\test2_new.py", line 15, in outfile.write(z.read(name)) IOError: (22, '

RE: unzip problem

2011-06-24 Thread Ahmed, Shakir
-Original Message- From: python-list-bounces+shahmed=sfwmd@python.org [mailto:python-list-bounces+shahmed=sfwmd@python.org] On Behalf Of Philip Semanchuk Sent: Friday, June 24, 2011 11:18 AM To: Lista-Comp-Lang-Python list Subject: Re: unzip problem On Jun 24, 2011, at 10:55 AM

RE: unzip problem

2011-06-24 Thread Ahmed, Shakir
On Fri, 24 Jun 2011 10:55:52 -0400, Ahmed, Shakir wrote: > Hi, > > > > I am getting following error message while unziping a .zip file. Any > help or idea is highly appreciated. How do you know it is when unzipping the file? Maybe it is, or maybe it isn't. The line giving the error has *two*

Re: unzip problem

2011-06-24 Thread Philip Semanchuk
On Jun 24, 2011, at 10:55 AM, Ahmed, Shakir wrote: > Hi, > > > > I am getting following error message while unziping a .zip file. Any > help or idea is highly appreciated. > > > > Error message>>> > > Traceback (most recent call last): > > File "C:\Zip_Process\py\test2_new.py", line 15,

Re: unzip problem

2011-06-24 Thread Steven D'Aprano
On Fri, 24 Jun 2011 10:55:52 -0400, Ahmed, Shakir wrote: > Hi, > > > > I am getting following error message while unziping a .zip file. Any > help or idea is highly appreciated. How do you know it is when unzipping the file? Maybe it is, or maybe it isn't. The line giving the error has *two*

unzip problem

2011-06-24 Thread Ahmed, Shakir
Hi, I am getting following error message while unziping a .zip file. Any help or idea is highly appreciated. Error message>>> Traceback (most recent call last): File "C:\Zip_Process\py\test2_new.py", line 15, in outfile.write(z.read(name)) IOError: (22, 'Invalid argument')