caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] bindings for xz compression and decompression ?
@ 2016-09-08  7:05 Ralf Treinen
  2016-09-08 18:20 ` Bergman Andrey
  2016-09-21 15:46 ` Adrien Nader
  0 siblings, 2 replies; 6+ messages in thread
From: Ralf Treinen @ 2016-09-08  7:05 UTC (permalink / raw)
  To: caml-list

Hi,

are there any bindings for xz compression and decompression? camlzip doesn't
seem to include these, according to [1]. Debian is in the process of moving
its repository indexes to xz compression, so we (dose) will in the near future
need at least a way to read these compressed files.

Could this be added to camlzip?

-Ralf.

[1] https://forge.ocamlcore.org/projects/camlzip/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] bindings for xz compression and decompression ?
  2016-09-08  7:05 [Caml-list] bindings for xz compression and decompression ? Ralf Treinen
@ 2016-09-08 18:20 ` Bergman Andrey
  2016-09-08 19:45   ` Eric Cooper
  2016-09-21 15:46 ` Adrien Nader
  1 sibling, 1 reply; 6+ messages in thread
From: Bergman Andrey @ 2016-09-08 18:20 UTC (permalink / raw)
  To: Ralf Treinen, caml-list

> Could this be added to camlzip?

Probably not, because there is a separate bzip2 binding, which is not merged into camlzip.

Combined binding library for different archive would infect system with multiple dependencies. Moreover, some archive types, like xz or rar are OS specific (they nearly are not present in other OSes).

> are there any bindings for xz compression and decompression?

There is an outdated binding for lzma. I can update it, if you really need that.

08.09.2016, 10:05, "Ralf Treinen" <treinen@free.fr>:
> Hi,
>
> are there any bindings for xz compression and decompression? camlzip doesn't
> seem to include these, according to [1]. Debian is in the process of moving
> its repository indexes to xz compression, so we (dose) will in the near future
> need at least a way to read these compressed files.
>
> Could this be added to camlzip?
>
> -Ralf.
>
> [1] https://forge.ocamlcore.org/projects/camlzip/
>
> --
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] bindings for xz compression and decompression ?
  2016-09-08 18:20 ` Bergman Andrey
@ 2016-09-08 19:45   ` Eric Cooper
  2016-09-08 23:25     ` Ben Millwood
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Cooper @ 2016-09-08 19:45 UTC (permalink / raw)
  To: caml-list

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] bindings for xz compression and decompression ?
  2016-09-08 19:45   ` Eric Cooper
@ 2016-09-08 23:25     ` Ben Millwood
  2016-09-13 20:15       ` Ralf Treinen
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Millwood @ 2016-09-08 23:25 UTC (permalink / raw)
  To: Eric Cooper, caml users

[-- 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 --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] bindings for xz compression and decompression ?
  2016-09-08 23:25     ` Ben Millwood
@ 2016-09-13 20:15       ` Ralf Treinen
  0 siblings, 0 replies; 6+ messages in thread
From: Ralf Treinen @ 2016-09-13 20:15 UTC (permalink / raw)
  To: caml users

Hiello again,

thanks to everybody for your replies.

On Fri, Sep 09, 2016 at 07:25:12AM +0800, Ben Millwood wrote:

> 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.

I think I will follow that line (and I only need a reader, not a writer).

Cheers -Ralf.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] bindings for xz compression and decompression ?
  2016-09-08  7:05 [Caml-list] bindings for xz compression and decompression ? Ralf Treinen
  2016-09-08 18:20 ` Bergman Andrey
@ 2016-09-21 15:46 ` Adrien Nader
  1 sibling, 0 replies; 6+ messages in thread
From: Adrien Nader @ 2016-09-21 15:46 UTC (permalink / raw)
  To: caml-list

Hi,

ocaml-archive[1] has read-only bindings to libarchive which handles xz
through liblzma. I've used it for quite a bit of time now. I have a few,
non-upstream, small patches to bind a few more functions (on-the-fly
path-rewrite, read from bigarray, extract to disk (?), getters and
setters for libarchive's "pathname",
archive_entry_{set_,}{hard,sym}link() and archive_entry_set_link). If
they're of interest I can take some time to share them properly (they're
already public, just not announced).

[1] https://forge.ocamlcore.org/projects/ocaml-archive/

-- 
Adrien Nadr

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-21 15:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-08  7:05 [Caml-list] bindings for xz compression and decompression ? Ralf Treinen
2016-09-08 18:20 ` Bergman Andrey
2016-09-08 19:45   ` Eric Cooper
2016-09-08 23:25     ` Ben Millwood
2016-09-13 20:15       ` Ralf Treinen
2016-09-21 15:46 ` Adrien Nader

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).