gzip
1 History
2011-may-17 Fixed "version 400" problem |
Translated doc.txt to doc.scrbl (JBC) |
2009-feb-6 Port to 4xx. |
Added support for mac os x. |
|
2007-feb-17 First release. |
- open-input-gz-file |
- open-output-gz-file |
- read-gz-file |
- compress-bytes |
- uncompress-bytes |
2 Introduction
This library provides bindings to the general purpose compression library zlib written by Jean-loup Gailly and Mark Adler.
http://www.zlib.net/manual.html
For convenience for Windows users, the dll-file zlib1.dll is included with this PLaneT package.
Note, that gzip-files are already supported in file/gzip and file/gunzip. However, as of 2011-04, those libraries don’t support the ADLER32 checksum, and therefore cannot be used to write zlib-encoded streams. This library therefore provides the easiest way to compress data terminated by an ADLER32 checksum.
3 Installation
On Mac and Unix download zlib, if you get an error message from the above.
4 Functions
(open-input-gz-file path) → port? |
path : path? |
> (define in (open-input-gz-file (string->path "fooo.gz"))) > (read-bytes 9 in) #"123344445" > (close-input-port in)
| ||||||||||||||
path : path? | ||||||||||||||
replace : boolean? = #f |
> (define out (open-output-gz-file "fooo.gz" #:replace #t)) > (write-bytes #"123" out) > (write-bytes #"344445" out) > (close-output-port out)
(read-gz-file path) → bytes? |
path : path? |
(compress-bytes bytes) → bytes? |
bytes : bytes? |
> (compress-bytes #"1234") #"x\2343426\1\0\1\370\0\313"
| ||||||||||||||
compressed : bytes? | ||||||||||||||
expanded-length : exact-nonnegative-integer? |
> (uncompress-bytes (compress-bytes #"1234") 4) #"1234"
5 Keywords
Keywords: _compression_ _decompression_ _gzip_ _gz_ _zlib_