mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2026-01-24 10:06:40 -05:00
merge bugfixes from master
This commit is contained in:
commit
4ed1691eb9
3 changed files with 4 additions and 2 deletions
|
|
@ -134,6 +134,7 @@ let _with_file_out filename f =
|
|||
begin try
|
||||
let x = f fmt in
|
||||
Format.pp_print_flush fmt ();
|
||||
close_out oc;
|
||||
x
|
||||
with e ->
|
||||
Format.pp_print_flush fmt ();
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ let _with_file_out filename f =
|
|||
let oc = open_out filename in
|
||||
begin try
|
||||
let x = f oc in
|
||||
close_out oc;
|
||||
x
|
||||
with e ->
|
||||
close_out_noerr oc;
|
||||
|
|
@ -148,7 +149,7 @@ let _with_file_out filename f =
|
|||
end
|
||||
|
||||
let to_file filename format =
|
||||
_with_file_out filename (fun oc -> kfprintf (fun _ -> close_out oc) oc format)
|
||||
_with_file_out filename (fun oc -> fprintf oc format)
|
||||
|
||||
(** {2 Monadic IO} *)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
(**
|
||||
(*
|
||||
* CCRingBuffer - Polymorphic Circular Buffer
|
||||
* Copyright (C) 2015 Simon Cruanes, Carmelo Piccione
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue