创建临时目录的存档并将其写入临时目录

时间:2017-11-02 20:09:54

标签: python shutil

我正在尝试创建临时目录的存档,并在完成后将该存档放在临时目录中。这样,我可以在我的Web应用程序中的请求完成后删除整个目录。

现在,当流程完成时,存档中还包含OutputArchive.zip文件。如何在不翻录的情况下将OutputArchive.zip写入temp_dir

代码

# zip all contents of this
temp_dir = r'E:\webapps\geodata-dev\data\tmpws55et'

# place the OutputArchive.zip in the above directory without zipping itself
shutil.make_archive(os.path.join(temp_dir, 'OutputArchive'), 'zip', temp_dir)

0 个答案:

没有答案
相关问题