search for: out_channel

Displaying 20 results from an estimated 69 matches for "out_channel".

2019 Mar 22
8
[PATCH 0/4] OCaml tools: output messages as JSON machine
Enhance the output in machine parseable mode, by outputting all the messages of OCaml tools as JSON to the machine parseable stream. Related, although not strictly needed for this (and thus can be split if requested), is the addition of the fd format for the machine readable stream. Pino Toscano (4): common/mltools: move the code for machine readable up common/mltools: make sure machine
2010 Mar 05
0
[LLVMdev] Last chance to get anything into llvm-c and ocaml bindings
...ml bindings for the soon to be released 2.7. Does anyone need any > other functions exposed before the code freeze on the 7th? Oh hey... I remember now. There is one thing I probably won't get around to doing myself until after the code freeze. (* Llvm_bitwriter *) val output_bitcode: out_channel -> Llvm.llmodule -> unit It would, of course, be awesome if you could get that into the 2.7 train. — j h woodyatt <jhw at conjury.org> http://jhw.vox.com/
2019 Mar 28
0
[PATCH v2 1/4] common/mltools: move the code for machine readable up
..._set_keys_from_stdin : unit -> unit = "guestfs_int_mllib_set_keys_from_stdin" "noalloc" +type machine_readable_fn = { + pr : 'a. ('a, unit, string, unit) format4 -> 'a; +} (* [@@unboxed] *) + +type machine_readable_output_type = + | NoOutput + | Channel of out_channel + | File of string +let machine_readable_output = ref NoOutput +let machine_readable_channel = ref None +let machine_readable () = + let chan = + if !machine_readable_channel = None then ( + let chan = + match !machine_readable_output with + | NoOutput -> None + |...
2010 Mar 04
4
[LLVMdev] Last chance to get anything into llvm-c and ocaml bindings
I've pretty much finished exposing all I wanted to llvm-c and the ocaml bindings for the soon to be released 2.7. Does anyone need any other functions exposed before the code freeze on the 7th?
2017 Feb 07
0
[PATCH v2 5/7] builder: add Index.write_entry function
...++++++++++++++++++++++++++++++++++++ builder/index_parser.mli | 6 ++++++ 3 files changed, 61 insertions(+) diff --git a/builder/index.mli b/builder/index.mli index ff5ec4a35..6202d636e 100644 --- a/builder/index.mli +++ b/builder/index.mli @@ -39,3 +39,6 @@ and entry = { } val print_entry : out_channel -> (string * entry) -> unit +(** Debugging helper function dumping an index entry to a stream. + To write entries for non-debugging purpose, use the + [Index_parser.write_entry] function. *) diff --git a/builder/index_parser.ml b/builder/index_parser.ml index a3cae7d1a..eb72602aa 100644...
2017 Feb 10
0
[PATCH v3 08/10] builder: add Index.write_entry function
...++++++++++++++++++++++++++++++++++++ builder/index_parser.mli | 6 ++++++ 3 files changed, 61 insertions(+) diff --git a/builder/index.mli b/builder/index.mli index ff5ec4a35..6202d636e 100644 --- a/builder/index.mli +++ b/builder/index.mli @@ -39,3 +39,6 @@ and entry = { } val print_entry : out_channel -> (string * entry) -> unit +(** Debugging helper function dumping an index entry to a stream. + To write entries for non-debugging purpose, use the + [Index_parser.write_entry] function. *) diff --git a/builder/index_parser.ml b/builder/index_parser.ml index a3cae7d1a..eb72602aa 100644...
2019 Mar 22
0
[PATCH 3/4] common/mltools: allow fd for machine readable output
...#include <guestfs.h> @@ -37,6 +40,7 @@ extern value guestfs_int_mllib_inspect_decrypt (value gv, value gpv, value keysv); extern value guestfs_int_mllib_set_echo_keys (value unitv); extern value guestfs_int_mllib_set_keys_from_stdin (value unitv); +extern value guestfs_int_mllib_open_out_channel_from_fd (value fdv); /* Interface with the guestfish inspection and decryption code. */ int echo_keys = 0; @@ -103,3 +107,16 @@ guestfs_int_mllib_set_keys_from_stdin (value unitv) keys_from_stdin = 1; return Val_unit; } + +value +guestfs_int_mllib_open_out_channel_from_fd (value fdv) +{...
2014 Dec 04
2
[PATCH v3 0/2] v2v: When picking a default kernel, favour non-debug
Since v2: - Use string_suffix kernel_name "-debug" || string_suffix kernel_name "-dbg" - This requires addition of the string_suffix function and some tests
2019 Mar 28
8
[PATCH v2 0/4] OCaml tools: output messages as JSON machine
Enhance the output in machine parseable mode, by outputting all the messages of OCaml tools as JSON to the machine parseable stream. Related, although not strictly needed for this (and thus can be split if requested), is the addition of the fd format for the machine readable stream. Changes from v1: - use Obj.magic to convert int -> Unix.file_descr - add tests Pino Toscano (4):
2016 Jul 07
0
[PATCH v3 2/8] curl: Change the API to use an abstract data type.
...l command. + + It actually uses the [curl --config] option to pass the arguments + securely to curl through an external file. Thus passwords etc are + not exposed to other users on the same machine. + The result is the output of curl as a list of lines. *) -val print_curl_command : out_channel -> curl_args -> unit -(** Print the curl command line. This elides any arguments that - might contain passwords, so is useful for debugging. *) +val to_string : t -> string +(** Convert the curl command line to a string. + + This elides any arguments that might contain passwords, so...
2017 Mar 07
0
[PATCH v4 5/9] builder: add Index_parser.write_entry function
...ck_PROGRAMS += yajl_tests index_parser_tests +TESTS += yajl_tests index_parser_tests endif check-valgrind: diff --git a/builder/index.mli b/builder/index.mli index ff5ec4a35..6202d636e 100644 --- a/builder/index.mli +++ b/builder/index.mli @@ -39,3 +39,6 @@ and entry = { } val print_entry : out_channel -> (string * entry) -> unit +(** Debugging helper function dumping an index entry to a stream. + To write entries for non-debugging purpose, use the + [Index_parser.write_entry] function. *) diff --git a/builder/index_parser.ml b/builder/index_parser.ml index a3cae7d1a..9b3daed24 100644...
2016 Jul 07
0
[PATCH v2 2/8] curl: Change the API to use an abstract data type.
...l command. + + It actually uses the [curl --config] option to pass the arguments + securely to curl through an external file. Thus passwords etc are + not exposed to other users on the same machine. + The result is the output of curl as a list of lines. *) -val print_curl_command : out_channel -> curl_args -> unit -(** Print the curl command line. This elides any arguments that - might contain passwords, so is useful for debugging. *) +val to_string : t -> string +(** Convert the curl command line to a string. + + This elides any arguments that might contain passwords, so...
2016 Jul 07
4
[PATCH 0/3] Move Curl wrapper to mllib and use it for virt-builder.
Move the Curl wrapper module from virt-v2v to mllib. Use the module when virt-builder issues curl calls. Rich.
2017 Sep 18
0
[PATCH v9 4/7] builder: add Index.write_entry function
...ck_PROGRAMS += yajl_tests index_parser_tests +TESTS += yajl_tests index_parser_tests endif check-valgrind: diff --git a/builder/index.mli b/builder/index.mli index ff5ec4a35..6202d636e 100644 --- a/builder/index.mli +++ b/builder/index.mli @@ -39,3 +39,6 @@ and entry = { } val print_entry : out_channel -> (string * entry) -> unit +(** Debugging helper function dumping an index entry to a stream. + To write entries for non-debugging purpose, use the + [Index_parser.write_entry] function. *) diff --git a/builder/index_parser.ml b/builder/index_parser.ml index 02c124df3..3987cc385 100644...
2017 Oct 27
0
[PATCH v11 6/8] builder: add Index.write_entry function
...ck_PROGRAMS += yajl_tests index_parser_tests +TESTS += yajl_tests index_parser_tests endif check-valgrind: diff --git a/builder/index.mli b/builder/index.mli index 43d5485fb..3ed633ddc 100644 --- a/builder/index.mli +++ b/builder/index.mli @@ -44,3 +44,6 @@ and entry = { } val print_entry : out_channel -> (string * entry) -> unit +(** Debugging helper function dumping an index entry to a stream. + To write entries for non-debugging purpose, use the + [Index_parser.write_entry] function. *) diff --git a/builder/index_parser.ml b/builder/index_parser.ml index 7f64d0d98..0fc3ecc06 100644...
2017 Oct 05
0
[PATCH v11 4/6] builder: add Index.write_entry function
...ck_PROGRAMS += yajl_tests index_parser_tests +TESTS += yajl_tests index_parser_tests endif check-valgrind: diff --git a/builder/index.mli b/builder/index.mli index ff5ec4a35..6202d636e 100644 --- a/builder/index.mli +++ b/builder/index.mli @@ -39,3 +39,6 @@ and entry = { } val print_entry : out_channel -> (string * entry) -> unit +(** Debugging helper function dumping an index entry to a stream. + To write entries for non-debugging purpose, use the + [Index_parser.write_entry] function. *) diff --git a/builder/index_parser.ml b/builder/index_parser.ml index 6f611a7f5..4405eca12 100644...
2018 Aug 21
0
[PATCH 2/2] OCaml tools: add output selection for --machine-readable
...f --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml index 920977e42..271e7d55f 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -229,10 +229,60 @@ let human_size i = ) ) +type machine_readable_output_type = + | NoOutput + | Channel of out_channel + | File of string +let machine_readable_output = ref NoOutput +let machine_readable_channel = ref None +let machine_readable_printf fs = + let get_machine_readable_channel () = + let open_machine_readable_channel () = + match !machine_readable_output with + | NoOutput -> +...
2019 Mar 28
0
[PATCH v2 3/4] common/mltools: allow fd for machine readable output
...cat "$fn" | wc -l) -eq 1 diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml index ade4cb37f..35478f39e 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -41,6 +41,7 @@ type machine_readable_output_type = | NoOutput | Channel of out_channel | File of string + | Fd of int let machine_readable_output = ref NoOutput let machine_readable_channel = ref None let machine_readable () = @@ -50,7 +51,10 @@ let machine_readable () = match !machine_readable_output with | NoOutput -> None | Channel chan -> S...
2017 Nov 07
0
[PATCH] common/mlstdutils: Add with_openfile function.
...let buf = Buffer.create 16384 in with_open_in path ( diff --git a/common/mlstdutils/std_utils.mli b/common/mlstdutils/std_utils.mli index 7af6c2111..e30d8eec3 100644 --- a/common/mlstdutils/std_utils.mli +++ b/common/mlstdutils/std_utils.mli @@ -399,6 +399,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_descr -> 'a) -> 'a +(** [with_open...
2017 Nov 05
0
[PATCH 2/2] common/mlstdutils: Add with_openfile function.
...let buf = Buffer.create 16384 in with_open_in path ( diff --git a/common/mlstdutils/std_utils.mli b/common/mlstdutils/std_utils.mli index 7af6c2111..178762819 100644 --- a/common/mlstdutils/std_utils.mli +++ b/common/mlstdutils/std_utils.mli @@ -399,6 +399,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_openf...