Tim Williams (gmail) wrote:
Using zipfile.Zipfile
How can I add a file to a zip file and keep its date and time correct?
Currently the date/time change to the time the file was added to the
zip. Zipinfo doesn't have a write method!
Solutions other than zipfile are welcome, with snippets if possible :)
I am working some new code for zipfile. If you are interested in a
partial step towards what you want, at the cost of having to read
and/or use a bunch of half-done code, grab a copy of:
http://members.dsl-only.net/~daniels/zipf.py
You should then be able to do something like:
import zipf
z = zipf.ZipFile('w hatever.zip', 'a')
and then copy the code for .write(...)
using your own zinfo block. I imagine I'll eventually have a method
like that named ".write_info(zi nfo, data_iterator)" or something.
--Scott David Daniels
Sc***********@A cm.Org