Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 14f9d1392cdb31b82b42df8a6fcda1e4 > files > 18

ocaml-res-devel-3.2.0-1mdv2010.0.i586.rpm

(* Reads a file given as first argument into a buffer and prints it
   out again. Uses an exponentially growing read-ahead during reading
   (just for demonstration). *)

let _ =
  let buf = Res.Buffer.empty ()
  and file = open_in Sys.argv.(1) in
  Res.Buffer.add_full_channel_f buf file 50000 (( * ) 2);
  Res.Buffer.output_buffer stdout buf