From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id D86C07ED1A for ; Sat, 19 May 2012 00:14:06 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAHTItk9QRFuw/2dsb2JhbABFtBCBB4IVAQEFOj8QCxgcEhQoIYglB7xJin+EZGIDlR+BEI5mgmo X-IronPort-AV: E=Sophos;i="4.75,618,1330902000"; d="scan'208";a="144282784" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 19 May 2012 00:14:06 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.72) (envelope-from ) id 1SVVQy-0007ax-Eq; Fri, 18 May 2012 23:14:04 +0100 Date: Fri, 18 May 2012 23:14:04 +0100 From: "Richard W.M. Jones" To: Francois Berenger Cc: caml-list , batteries-devel@lists.forge.ocamlcore.org, OCaml Beginners List Message-ID: <20120518221404.GA26540@annexia.org> References: <4FB1B5F3.3080908@riken.jp> <4FB1B60F.3060408@riken.jp> <4FB1BB82.6010900@riken.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FB1BB82.6010900@riken.jp> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [Caml-list] Any library for reading/writing compressed files? On Tue, May 15, 2012 at 11:12:18AM +0900, Francois Berenger wrote: > Hello, > > 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). Rich. -- Richard Jones Red Hat