Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 01b59e159e
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (19 sloc) 0.684 kB
let compress infile outfile =
let ic = open_in_bin infile
and oc = open_out_bin outfile in
Zlib.compress (fun buf -> input ic buf 0 (String.length buf))
(fun buf len -> output oc buf 0 len);
close_in ic;
close_out oc
let uncompress infile outfile =
let ic = open_in_bin infile
and oc = open_out_bin outfile in
Zlib.uncompress (fun buf -> input ic buf 0 (String.length buf))
(fun buf len -> output oc buf 0 len);
close_in ic;
close_out oc
let _ =
if Array.length Sys.argv >= 4 && Sys.argv.(1) = "-d" then
uncompress Sys.argv.(2) Sys.argv.(3)
else if Array.length Sys.argv >= 3 then
compress Sys.argv.(1) Sys.argv.(2)
Jump to Line
Something went wrong with that request. Please try again.