[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] z3: gzip compatibility
From: |
Daishi Kato |
Subject: |
Re: [Chicken-users] z3: gzip compatibility |
Date: |
Tue, 02 Dec 2008 19:01:57 +0900 |
User-agent: |
Wanderlust/2.15.6 (Almost Unreal) Emacs/21.4 Mule/5.0 (SAKAKI) |
At Tue, 2 Dec 2008 10:04:29 +0100,
Tobia Conforto wrote:
>
> Daishi Kato wrote:
> > Does anyone know if I can use z3 egg to reproduce the same result
> > made by gzip?
>
> Yes you can, but you have to use the right functions.
>
> Note that a file in gzip format includes some zlib-encoded data, after
> a header, but it's not plain zlib-encoded data.
>
> This works:
>
> $ echo hello > test
> $ gzip test
> $ csi -q
> #;1> (use z3)
> ; loading /usr/local/lib/chicken/3/z3.so ...
> #;2> (read (z3:open-compressed-input-file "test.gz"))
> hello
> #;3>
Thanks Toiba and Felix.
Can I do it without using the file? maybe using string or port.
In other words, how can I encode/decode the header.
The documentation does not seem to help me on it.
I'm thinking of using it with http-server (or spiffy)
to support Content-Encoding: gzip.
Best,
Daishi