[erlang-questions] Questions about zip

Low Kian Seong <>
Fri May 16 10:24:11 CEST 2014


Thank you very much well, for the benefit of others that might be following
this thread, let me give a full example of unzipping the "dome.zip" file:

10> {ok, ZipHandle2}=zip:zip_open("dome.zip", [{cwd,
<<"/home/lowks/Downloads">>}]).
{ok,<0.60.0>}
13> zip:zip_get(ZipHandle3).
{ok,[<<"/home/lowks/Downloads/dome.csv">>]}

When you check in '/home/lowks/Downloads/' you will see that the 'dome.zip'
has been unzipped. the 'zip.zip_get(ZipHandle3).' can be run as many times
as you want. Finally to close it, do this:

14> zip:zip_close(ZipHandle3).
ok

Thanks for the answers.


[image: Low Kian Seong on about.me]

Low Kian Seong
about.me/lowkianseong
    <http://about.me/lowkianseong>


On Fri, May 16, 2014 at 3:44 PM, deng lifen <> wrote:

> http://www.erlang.org/doc/man/zip.html#zip_list_dir-1
>
>
> 在 2014年5月16日,15:39,Low Kian Seong <> 写道:
>
> It's better now, I get this:
>
> 1> zip:zip_open("dome.zip", [{cwd, <<"/home/lowks/Downloads">>}]).
> {ok,<0.34.0>}
>
> but where is the unzipped content anyway ?
>
>
> [image: Low Kian Seong on about.me]
>
> Low Kian Seong
> about.me/lowkianseong
>     <http://about.me/lowkianseong>
>
>
> On Fri, May 16, 2014 at 3:33 PM, deng lifen <> wrote:
>
>>
>> 1> zip:zip_open("dome.zip", [{cwd, <<"/home/lowks/Downloads">>}]).
>>
>>
>> 在 2014年5月16日,15:22,Low Kian Seong <> 写道:
>>
>> I got this:
>>
>> 6> zip:zip_open('dome.zip', [{'cwd', <<'/home/lowks/Downloads'>>}]).
>> ** exception error: bad argument
>>
>>
>>
>> [image: Low Kian Seong on about.me]
>>
>> Low Kian Seong
>> about.me/lowkianseong
>>     <http://about.me/lowkianseong>
>>
>>
>> On Fri, May 16, 2014 at 3:07 PM, deng lifen <> wrote:
>>
>>> try this:
>>>
>>> zip:zip_open('dome.zip', [{'cwd', <<'/home/lowks/Downloads'>>}]).
>>>
>>>
>>> 在 2014年5月16日,14:58,Low Kian Seong <> 写道:
>>>
>>> First of all sorry, I am a beginner and the docs are a bit confusing to
>>> me. Can someone tell me what is wrong with this?
>>>
>>> 2> zip:zip_open('dome.zip', [{'cwd': <<'/home/lowks/Downloads'>>}])
>>> 2> .
>>> * 1: illegal expression
>>>
>>> also The second one gives back ok, but when I check the zip file is
>>> still compressed.
>>>
>>> 4> zip:zip_open("dome.zip").
>>> {ok,<0.40.0>}
>>>
>>>
>>> Some help is greatlly appreciated. Thanks.
>>>
>>> [image: Low Kian Seong on about.me]
>>>
>>> Low Kian Seong
>>> about.me/lowkianseong
>>>     <http://about.me/lowkianseong>
>>>  _______________________________________________
>>> erlang-questions mailing list
>>> 
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>>
>>> deng lifen
>>> 
>>>
>>>
>>>
>>>
>>
>> deng lifen
>> 
>>
>>
>>
>>
>
> deng lifen
> 
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140516/0e3e2692/attachment.html>


More information about the erlang-questions mailing list