erlang zip:unzip/1 {error, bad_central_directory} and {error, bad_eocd}

风流意气都作罢 提交于 2019-12-22 18:19:54

问题


I have always used erlang stdlib library zip:unzip/1 successfully. Last night i hit a bar with this error:

E:\WimaxStatsParser-1.1>erl
Eshell V5.9.2  (abort with ^G)
1> zip:unzip("e:/WimaxStatsParser-1.1/in/SomeZipFile.zip").
{error,bad_central_directory}
2>

Some one help explain the cause for this ? and how i get around it ?

ADDITIONS


I got some other error on another file: {error,bad_eocd}. Please explain this as well.

回答1:


I am not able to reproduce your problem with the information you give. There are 2 functions that may send this error:

get_cd_loop/5 and get_name_extra_comment/4 in stdlib-1.18.2/src/zip.erl .

it should be easy to debug

copy the file zip.erl, zip.hrl, file.hrl in a working directory,

compile with debug_info option, you will get the error message "Can't load module that resides in sticky dir", leave the VM

copy zip.beam in the stdlib.../ebin

restart the VM in the working directory, you can now add breakpoint in the zip.erl source.

BR

Pascal.



来源:https://stackoverflow.com/questions/12908409/erlang-zipunzip-1-error-bad-central-directory-and-error-bad-eocd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!