Any library for reading/writing compressed files?

> What's the gold standard in OCaml to read/write
> compressed files?
>
> I found this: http://forge.ocamlcore.org/projects/camlzip/
>
> Wouldn't it be possible that the Marshall module
> had an option to allow compression of the marshalled
> values?
> Or is there a simple way to achieve this?
If it's for Unix, then just open a pipe to or from an external
compression filter, eg:
open Unix
open Printf
let () =
let output = "output.xz" in
let chan =
open_process_out (sprintf "xz --best > %s"
(Filename.quote output)) in
output_value chan 42;
let status = close_process_out chan in
(* some code here to check status was ok *)
()
(Also a good way to generate images from OCaml programs: pipe
to pnmto* programs).

Adrien Nader also replied:

There are libarchive bindings by Sylvain Le Gall on the forge too.
They're partial but already work for reading iirc, and writing
shouldn't be a lot of work (if it hasn't been added since I last
looked at it). That will potentially give xz, gzip, bzip2, tar, cpio
and I don't know what else.