Re:从zip文件中提取.. [英] Re: extract from zip files..

查看:155
本文介绍了Re:从zip文件中提取..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我是python的新手,我一直在尝试使用zipfile模块,因为我每天处理大量的zip文件,我想自动化我的工作。我的问题是:我如何保留日期和我从zip文件解压缩的文件的时间戳..我已经知道如何解压缩但是写了一个新的时间戳(时间和日期解压缩)..重要的是我保留了zipfile中的原始文件..有人可以帮帮我吗?在此先感谢.. :)我一直试图解决这个问题,但解决方案一直在躲避我...

展开 | 选择 | Wrap | 行号

解决方案


你好,我对python很新我一直在尝试使用zipfile模块,因为我每天处理大量的zip文件,我想自动化我的工作。我的问题是:我如何保留我已经'解压缩的文件的日期和时间戳''来自zip文件..我已经知道如何解压缩但是写了一个新的时间戳(时间和日期解压缩)..重要的是我保留了zipfile中的原始文件。有人可以帮助我吗?提前感谢.. :)我一直试图解决这个问题,但解决方案一直在躲避我..

展开 | 选择 | Wrap | 行号


欢迎来到脚本。

我相信你可以使用utime()函数设置这些时间戳。

谢谢伙计们......按照建议尝试 tar 现在我正在使用 zipfile 模块编写zip文件和时间戳是保存得很好......虽然我想保留时间戳,但我很困惑...我已经尝试了 utime 但我很难将值绑定到 mtime 我从 getinfo 得到了...我想生病了这一点,直到我得到它,但如果我不,病了回来......再次感谢一堆...... :) />

纠正我,如果我错了,当我使用 utime 时,我可以使用 atime 的任何时间值,对吗?


编辑:顺便说一句,这是我第一次参加这个论坛,我印象深刻..我希望能够nd

在这里回家..谢谢 Motoma :)


hello, i am quite new to python and i have been experimenting with the zipfile module since i deal with a lot of zip files everyday and i want to automate my work..my question is: how do i retain the date and time stamp of the files that i have ''unzipped'' from the zip file..i already know how to unzip but a new timestamp is written (time and day unzipped)..it is important that i retain the original from the zipfile..can someone help me out?thanks in advance.. :) been trying to solve this myself but the solution keeps on evading me..

Expand|Select|Wrap|Line Numbers

解决方案

hello, i am quite new to python and i have been experimenting with the zipfile module since i deal with a lot of zip files everyday and i want to automate my work..my question is: how do i retain the date and time stamp of the files that i have ''unzipped'' from the zip file..i already know how to unzip but a new timestamp is written (time and day unzipped)..it is important that i retain the original from the zipfile..can someone help me out?thanks in advance.. :) been trying to solve this myself but the solution keeps on evading me..

Expand|Select|Wrap|Line Numbers


Welcome to theScripts.
I believe you can set these timestamps using the utime() function.


thanks guys..ill try tar as suggested..right now im using the zipfile module when i write the zip file and the time stamp is well preserved..am confused about the extract part though cos i want to retain the time stamp.. i have tried utime but im having a hard time binding the values to mtime which i got from getinfo..i guess ill do this a bit more till i get it but if i don''t,ill be back..thanks a bunch again.. :)

correct me if im wrong, i can use any time value for atime when i use utime, right?

EDIT: by the way,its my 1st time in this forum and i am impressed..i hope to find
a home here..thanks Motoma :)


这篇关于Re:从zip文件中提取..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆