I am getting an error whenever i try to run following unzip command from a python script which is running as a daemon
Command :
unzip abcd.zip > /dev/null
Error
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.
Could anyone help me in this regard?
Thanks in advance.
Usually that would mean exactly what it says: that the file
abcd.zipis not a valid ZIP file. Are you able tounzip abcd.zipas a normal user? If not, it would seem to have become corrupted. How did you get hold of it? Check for newline-mangling operations like ASCII-mode FTP.Can you read the file with the built-in Python zipfile module? Handling files directly in Python is generally preferable to kicking it out onto the command line.