0

每当我尝试从作为守护进程运行的 python 脚本中运行以下解压缩命令时,我都会收到错误消息

命令 :

解压缩 abcd.zip > /dev/null

错误

End-of-central-directory signature not found$ a zip file, or it 
constitutes one disk of a multi-part archive. In the latter case
the central directory and zipfile comment will be found on the last 
disk(s) of this archive

unzip:  cannot find zipfile directory in one of abcd.zip$
        abcd.zip.zip, and cannot find abcd.zip.ZIP, period.

有人可以在这方面帮助我吗?

提前致谢。

4

2 回答 2

1

通常这意味着它所说的:该文件abcd.zip不是有效的 ZIP 文件。你能unzip abcd.zip作为普通用户吗?如果没有,它似乎已经损坏了。你是怎么掌握的?检查换行符操作,如 ASCII 模式 FTP。

你能用内置的 Python zipfile模块读取文件吗?直接在 Python 中处理文件通常比将其踢到命令行更可取。

于 2010-06-01T11:55:50.433 回答
0

首先验证文件。这看起来像是一个损坏/无效的 zip 文件。

于 2010-06-01T11:59:36.790 回答