Created
October 14, 2016 22:34
-
-
Save rgrinberg/bf025b31d594216c2472851981ccd03e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Core.Std | |
let compress s = | |
let (r, w) = Unix.pipe () in | |
let w = Unix.out_channel_of_descr w in | |
let gz = Gzip.open_out_chan w in | |
Gzip.output gz s 0 (String.length s); | |
Gzip.close_out gz; | |
let r = Unix.in_channel_of_descr r in | |
In_channel.input_all r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment