Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Being able to (un)marshal to/from compressed files #5615

Closed
vicuna opened this issue May 15, 2012 · 2 comments
Closed

Being able to (un)marshal to/from compressed files #5615

vicuna opened this issue May 15, 2012 · 2 comments

Comments

@vicuna
Copy link

vicuna commented May 15, 2012

Original bug ID: 5615
Reporter: berenger
Assigned to: @alainfrisch
Status: resolved (set by @alainfrisch on 2012-05-15T13:59:29Z)
Resolution: suspended
Priority: normal
Severity: feature
Version: 3.12.1
Category: standard library

Bug description

Hello,

It would be nice to support reading/writing
from/to compressed files.
The compression level should be an optional
user-supplied parameter.

Regards,
F.

@vicuna
Copy link
Author

vicuna commented May 15, 2012

Comment author: @alainfrisch

I don't see that happening in the standard distribution: this would either introduce a dependency to an external compression library or require to integrate one in OCaml's source tree.

Ideally, the marshaler/demarshaler should have an API to allow plugging custom input/output streams. Unfortunately, given the current implementation, it is difficult to call back into OCaml code during marshaling/demarshaling. This could be done at the C level in order to allow plugging an external compression library.

I'm suspending this ticket for now. If someone from the community is willing to work on it, I suggest contacting the developers first to see if there is a chance of having such a patch accepted.

@vicuna vicuna closed this as completed May 15, 2012
@vicuna
Copy link
Author

vicuna commented May 15, 2012

Comment author: @xavierleroy

To complement A. Frisch's reply: you can always marshal to/from strings, using Marshal.to_string and Marshal.from_string, then combine this with whatever compression method you'd like. (The Camlzip library, http://forge.ocamlcore.org/projects/camlzip/, could be a good candidate for the compression part.)

The OCaml Batteries library (http://batteries.forge.ocamlcore.org/) has support for custom input/output streams, but not yet for compressed streams, if I understand correctly. It could still be worth asking on the OCaml Batteries mailing-list, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants