Discussion:
[Caml-list] bindings for xz compression and decompression ?
(too old to reply)
Ralf Treinen
2016-09-08 07:05:41 UTC
Permalink
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
Bergman Andrey
2016-09-08 18:25:35 UTC
Permalink
Post by Ralf Treinen
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).
Post by Ralf Treinen
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.
Post by Ralf Treinen
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/
--
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
--
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
Eric Cooper
2016-09-08 19:46:03 UTC
Permalink
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
Ralf Treinen
2016-09-13 20:16:11 UTC
Permalink
Hiello again,

thanks to everybody for your replies.
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.
--
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
Adrien Nader
2016-09-21 15:47:15 UTC
Permalink
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
--
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
Loading...