caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Ben Millwood <bmillwood@janestreet.com>
To: Eric Cooper <ecc@cmu.edu>, caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] bindings for xz compression and decompression ?
Date: Fri, 9 Sep 2016 07:25:12 +0800	[thread overview]
Message-ID: <CA+MHO51jgX78TYrfx+rpmSavTMHpekkJ9duX1mbijij95CXo9w@mail.gmail.com> (raw)
In-Reply-To: <20160908194545.kzr4bxhmvjwb3iv7@cooper-siegel.org>

[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

async_extended has Async_extended.Std.Reader.with_xzip_file

https://ocaml.janestreet.com/ocaml-core/latest/doc/async_extended/Std/Reader.mod/#/with_xzip_file.val

Internally it just invokes xzcat, which may or may not satisfy your
requirements. There's (as far as I know) no provided way to write xz files.

On 9 September 2016 at 03:45, Eric Cooper <ecc@cmu.edu> wrote:

> In approx, I just use a Sys.command call to decompress to a temporary
> file and then open that.  It has these benefits:
>   * for gzip at least, it's faster than camlzip
>   * easily detects corrupted files (reading the output stream of a
>     decompressor doesn't do that until it's too late)
>   * easy to change compression schemes or support multiple ones based
>     on file extension, say
>
> --
> Eric Cooper             e c c @ c m u . e d u
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 1927 bytes --]

  reply	other threads:[~2016-09-08 23:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08  7:05 Ralf Treinen
2016-09-08 18:20 ` Bergman Andrey
2016-09-08 19:45   ` Eric Cooper
2016-09-08 23:25     ` Ben Millwood [this message]
2016-09-13 20:15       ` Ralf Treinen
2016-09-21 15:46 ` Adrien Nader

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+MHO51jgX78TYrfx+rpmSavTMHpekkJ9duX1mbijij95CXo9w@mail.gmail.com \
    --to=bmillwood@janestreet.com \
    --cc=caml-list@inria.fr \
    --cc=ecc@cmu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).