Re: Add file to zip, or replace file in zip

2006-06-01 Thread Chris Lambacher
Skip over the file in question when you first are zipping the directory. Unfortunately you cannot replace or remove a file from a zip without unzipping and rezipping all the contents. -Chris On Wed, May 31, 2006 at 03:10:53PM +0800, majj81 wrote: >hi: > Good afternoon. > Has this pr

Add file to zip, or replace file in zip

2006-05-31 Thread majj81
hi:   Good afternoon.   Has this problem solved in the URL http://mail.python.org/pipermail/python-list/2006-April/338849.html . Now I have the same problem to deal with. If you have any suggestion please tell me.   Thanks.     Johnny Ma  

Re: Add file to zip, or replace file in zip

2006-05-01 Thread Edward Elliott
Scott David Daniels wrote: > Actually I think it was a combination of CP/M and DOS that popularized > the ZIP format; essentially the floppy-disk set, for whom the zip format > was a godsend. Ah you're right. I just lump all Microsoft OSes under the term 'Windows' now, though I suppose that's unf

Re: Add file to zip, or replace file in zip

2006-05-01 Thread Scott David Daniels
Edward Elliott wrote: > Scott David Daniels wrote: > >> Edward Elliott wrote: >>> Scott David Daniels wrote: ... >> > ... You windows kids and your crazy data formats. >> There were a few oth OS's than Linux and Windows. Maybe you >> should call me "you crazy Tenex kid." > > Windows popu

Re: Add file to zip, or replace file in zip

2006-05-01 Thread Edward Elliott
Scott David Daniels wrote: > Edward Elliott wrote: >> Scott David Daniels wrote: >>>... > > ... You windows kids and your crazy data formats. > There were a few oth OS's than Linux and Windows. Maybe you > should call me "you crazy Tenex kid." Windows popularized the zip format, but if you in

Re: Add file to zip, or replace file in zip

2006-05-01 Thread Scott David Daniels
Edward Elliott wrote: > Scott David Daniels wrote: >>... > ... You windows kids and your crazy data formats. There were a few oth OS's than Linux and Windows. Maybe you should call me "you crazy Tenex kid." Knuth says, "the fastest way to search is to know where to go." -- Zips have locations of

Re: Add file to zip, or replace file in zip

2006-04-30 Thread Edward Elliott
Scott David Daniels wrote: > It is not currently possible to delete or replace individual elements > in a zip file, nor (in all likelihood) would you want to do so. It > would require having the zip[ file in a broken state for some time > as you copy data from one area of the zip to another. If

Re: Add file to zip, or replace file in zip

2006-04-30 Thread Scott David Daniels
Roger Miller wrote: > First note that zipfile is a plain Python module, so reading > Python.../Lib/zipfile.py will reveal all its secrets. > > I don't think it is possible to replace archive members using the > module. You could copy all the files into a new zip file, replacing the > ones you want

Re: Add file to zip, or replace file in zip

2006-04-28 Thread Roger Miller
First note that zipfile is a plain Python module, so reading Python.../Lib/zipfile.py will reveal all its secrets. I don't think it is possible to replace archive members using the module. You could copy all the files into a new zip file, replacing the ones you want to change as you go. But it mig

Add file to zip, or replace file in zip

2006-04-28 Thread abcd
I have a script which zips up a directory, once it does with that (before it closes the zip file) I want to replace a file that was added to the zip, say "Foo.txt". So I tried this... [code] z = zipfile.ZipFile("blah.zip", "w") # zip the directory #... z.writestr("c:\\path\\to\\current\\foo_txt_fi