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

Functorize Zip reading/writing functionality to permit different backends #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zindel
Copy link

@zindel zindel commented Jul 21, 2021

Motivation

Our web endpoint needs to construct fairly small zip files consisting of multiple CSVs (think export of multiple independent queries). With the current implementation, we need to use the temporary files, clean them up, involve disk I/O etc. Functorization of the Zip module permitted us to have memory backend for this operation, leaving all the heavy lifting in the Zip's responsibility, just collecting the Buffer.contents in the end.

Description

  • all changes are additive and backward-compatible
  • new names introduced in Zip.mli: READER, IN_CHANNEL, Make_reader, WRITER, OUT_CHANNEL, Make_writer
  • minizip test is updated (-b flag) to test/demonstrate new capabilities (functionally, it is the same as before)
  • for easier review, the changes are done in 3 commits: functorization itself, adding tests & fixing indentation(purely housekeeping, just indenting functors contents 2 symbols)
  • the code developed & tested with 4.07.0 as stated in camlzip.opam
  • works on production compiled with 4.11.2
  • the code may become redundant when Modular IO lands in the compiler, but quite useful until then

@ygrek
Copy link

ygrek commented Sep 27, 2021

this seems to be a popular request for camlzip, please consider this PR

@ygrek
Copy link

ygrek commented Dec 2, 2021

any feedback please? 🙏

@xavierleroy
Copy link
Owner

Apologies, but all my OCaml time is being consumed by the Multicore merge. Maybe it's time for me to find additional maintainers for Camlzip.

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

Successfully merging this pull request may close these issues.

3 participants