let output_lines oc ic = let limit = 8000 in let rec rd_lines oc ic n = match (Stdio.In_channel.input_line ic, n) with | Some _, n when n = limit -> n | None, _ -> n | Some l, n -> Printf.fprintf oc "%s\n" l; rd_lines oc ic (n + 1) in rd_lines oc ic 0