Using Zlib

Vladimir Sekissov svg@REDACTED
Wed Jun 19 18:25:12 CEST 2002


Good day, Willem,

willem> Willem Broekema wrote:
willem> > I assume Zlib is used in the Erlang runtime, but not available in Erlang 
willem> > programs?

I've looked around the code and it seemed they could use compressed files with
`compressed' flag.

So I tried:

15> {ok, FD} = file:open("/var/tmp/test", [write, compressed]).
{ok,<0.72.0>}
16> io:put_chars(F4, "Test, Test, Test").
ok
17> file:close(FD).
ok
29> file:read(FD1, 16).
{ok,"Test, Test, Test"}
30> file:close(FD1).
ok

When looked in shell:

$ file /var/tmp/test
test: gzip compressed data, deflated, last modified: Thu Jan  1
05:00:00 1970, os: Unix 


Best Regards,
Vladimir Sekissov



More information about the erlang-questions mailing list