473,379 Members | 1,201 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Date & time in a Zip File

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 :)

ginmf in this instance.
Jul 21 '05 #1
2 3058
When I add files to my .ZIP files using python zipfile module
the date/time that is stored in mine is the one that comes from
the file's attributes. I'm not sure I understand why you think
yours are not.

-Larry Bates
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 :)

ginmf in this instance.

Jul 21 '05 #2
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('whatever.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(zinfo, data_iterator)" or something.

--Scott David Daniels
Sc***********@Acm.Org
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gerry | last post by:
Help needed with this: I have had a guestbook-page in Europe and will now have to move it to a US based-server. This makes the time-function showing time 6 hours wrong. The time should be GMT...
4
by: Gerry | last post by:
As I'm not a PHP-prgrammer at all, I just need Help with this: I have had a guestbook-page in Europe and will now have to move it to a US based-server. This makes the time-function showing time...
2
by: msnews.microsoft.com | last post by:
Does the framework support the changing of a files Date and Time and if so is there sample could for which I can be directed?
6
by: Mike Charney | last post by:
Is there a way to check a files date and time stamp from VBA in access. I have a need check a date stamp on a file that I am importing. Thanks in advance, Mike m charney at dunlap hospital...
3
by: divya | last post by:
Hi, I have a table tblbwday with 2 fields Name and Birthday.I have written this script for displaying evryday names of the people on that day. <% set objConn...
1
by: aRTx | last post by:
<? /* Directory Listing Script - Version 2 ==================================== Script Author: Artani <artan_p@msn.com>. www.artxcenter.com REQUIREMENTS ============ This script requires...
3
by: Magesh | last post by:
How date-time attributes of a file are represented in the structure "struct stat"? Coz as I noted they found to be unsigned integers and I donno how they are interpreted as date & time in the...
1
by: adeebraza | last post by:
Hi, Every Body Following is code for Showing Actual Date & Time on the form and also record Date & Time of an event. See the following and use Call Modified when you want to record an event in...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.