Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005615OCamlOCaml standard librarypublic2012-05-15 05:472012-05-15 16:26
Assigned Tofrisch 
PlatformOSOS Version
Product Version3.12.1 
Target VersionFixed in Version 
Summary0005615: Being able to (un)marshal to/from compressed files

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

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
frisch (developer)
2012-05-15 15:59

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.
xleroy (administrator)
2012-05-15 16:26

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,, [^] could be a good candidate for the compression part.)

The OCaml Batteries library ( [^]) 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.

- Issue History
Date Modified Username Field Change
2012-05-15 05:47 berenger New Issue
2012-05-15 15:59 frisch Note Added: 0007435
2012-05-15 15:59 frisch Status new => resolved
2012-05-15 15:59 frisch Resolution open => suspended
2012-05-15 15:59 frisch Assigned To => frisch
2012-05-15 16:26 xleroy Note Added: 0007437

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker