Displaying 2 results from an estimated 2 matches for "file_desc".
Did you mean:
file_descr
2017 Nov 05
0
[PATCH 2/2] common/mlstdutils: Add with_openfile function.
...9,12 @@ val with_open_out : string -> (out_channel -> 'a) -> 'a
return or if the function [f] throws an exception, so this is
both safer and more concise than the regular function. *)
+val with_openfile : string -> Unix.open_flag list -> Unix.file_perm -> (Unix.file_desc -> 'a) -> 'a
+(** [with_openfile] calls function [f] with [filename] opened by the
+ {!Unix.openfile} function. The file is always closed either on
+ normal return or if the function [f] throws an exception, so this
+ is both safer and more concise than the regular function....
2017 Nov 05
3
[PATCH 1/2] common/mlstdutils: Add with_open_in and with_open_out functions.
These safe wrappers around Pervasives.open_in and Pervasives.open_out
ensure that exceptions escaping cannot leave unclosed files.
---
common/mlstdutils/std_utils.ml | 39 ++++++++++++++++++++--------------
common/mlstdutils/std_utils.mli | 12 +++++++++++
common/mltools/tools_utils.ml | 39 +++++++++++++++++-----------------
dib/dib.ml | 9 ++++----