Displaying 20 results from an estimated 60 matches for "end_of_file".
2017 Nov 21
3
[PATCH 0/3] Small improvements and fixes to urandom.
Small improvements and fixes to urandom.
2017 Nov 05
3
[PATCH 1/2] common/mlstdutils: Add with_open_in and with_open_out functions.
...p ();
- close_in chan;
+ );
Buffer.contents buf
(* Compare two version strings intelligently. *)
@@ -824,10 +833,10 @@ let last_part_of str sep =
with Not_found -> None
let read_first_line_from_file filename =
- let chan = open_in filename in
- let line = try input_line chan with End_of_file -> "" in
- close_in chan;
- line
+ with_open_in filename (
+ fun chan ->
+ try input_line chan with End_of_file -> ""
+ )
let is_regular_file path = (* NB: follows symlinks. *)
try (Unix.stat path).Unix.st_kind = Unix.S_REG
diff --git a/common/mlstduti...
2019 Aug 13
5
[PATCH 0/3] generator: pod2text-related improvements
- refactor memoization code
- pass pod as stdin rather than files
Pino Toscano (3):
generator: isolate memoized cache in own module
generator: adjust variable names
generator: improve pod2text invocation
generator/Makefile.am | 3 ++
generator/memoized_cache.ml | 62 +++++++++++++++++++++
generator/memoized_cache.mli | 29 ++++++++++
generator/utils.ml | 101
2019 Aug 13
0
[PATCH 3/3] generator: improve pod2text invocation
...put_line chan in
- if i = 1 && discard then (* discard the first line of output *)
- loop (i+1)
- else (
- let line = if trim then String.triml line else line in
- lines := line :: !lines;
- loop (i+1)
- ) in
- let lines : pod2text_memo_value = try loop 1 with End_of_file -> List.rev !lines in
- unlink filename;
- (match close_process_in chan with
+ (try while true do lines := input_line chan_out :: !lines done
+ with End_of_file -> ());
+ let lines = List.rev !lines in
+ (match close_process (chan_out, chan_in) with
| WEXITED 0 -> ()
| WEXIT...
2016 Sep 29
3
[PATCH 1/2] v2v: ova: fix checking of the manifest file
...utput of sha1sum command")
)
+ else
+ warning (f_"Unable to parse line from manifest file. Line is \"%s\"")
+ (String.replace line "\r" "")
+ ;
+ loop ()
in
(try loop () with End_of_file -> ());
close_in chan
--
2.10.0
2017 Oct 11
3
[PATCH 0/2] v2v: -i vmx: Allow deviceType field to be completely omitted.
A colleague found some VMX files which omit the deviceType field.
This allows -i vmx mode to parse them.
Rich.
2015 Feb 10
1
[PATCH] php: add a simple bindtests test
...h string_split ":" line with
+ | ("obool"|"oint"|"oint64"|"ostring"|"ostringlist") as x :: _ ->
+ pr "%s: unset\n" x
+ | _ -> pr "%s\n" line
+ );
+ loop ()
+ in
+ (try loop () with End_of_file -> ());
+ close_in chan in
+
+ dump "bindtests"
+
(* Language-independent bindings tests - we do it this way to
* ensure there is parity in testing bindings across all languages.
*)
diff --git a/generator/main.ml b/generator/main.ml
index 436d72d..abeae0c 100644
--- a/generato...
2016 Sep 29
0
Re: [PATCH 1/2] v2v: ova: fix checking of the manifest file
...)
> + else
> + warning (f_"Unable to parse line from manifest file. Line is \"%s\"")
> + (String.replace line "\r" "")
> + ;
> + loop ()
> in
> (try loop () with End_of_file -> ());
> close_in chan
>
Thanks,
--
Pino Toscano
2016 Sep 30
0
[PATCH 4/4] v2v: -i ova: use Checksums
...with Checksums.Mismatched_checksum (_, actual) ->
+ error (f_"checksum of disk %s does not match manifest %s (actual sha1(%s) = %s, expected sha1 (%s) = %s)")
+ disk mf disk actual disk expected;
)
in
(try loop () with End_of_file -> ());
--
2.7.4
2016 Oct 05
0
[PATCH v2 1/2] v2v: ova: fix checking of the manifest file
...k mf disk actual disk expected;
)
+ else
+ warning (f_"Unable to parse line from manifest file. Line is \"%s\"")
+ (String.replace line "\r" "")
+ ;
+ loop ()
in
(try loop () with End_of_file -> ());
close_in chan
--
2.10.0
2016 Oct 05
0
[PATCH v3 1/2] v2v: ova: fix checking of the manifest file
...disk mf disk actual disk expected;
)
+ else
+ warning (f_"unable to parse line from manifest file: %S") line
+ (String.replace line "\r" "")
+ ;
+ loop ()
in
(try loop () with End_of_file -> ());
close_in chan
--
2.10.0
2019 Jan 16
0
[PATCH 2/5] mltools: create a new external_command_code
...ot;external command ‘%s’ exited with error %d") cmd exitcode;
+ lines
+
+and external_command_code ?(echo_cmd = true) cmd =
if echo_cmd then
debug "%s" cmd;
let chan = Unix.open_process_in cmd in
@@ -347,18 +353,10 @@ let external_command ?(echo_cmd = true) cmd =
with End_of_file -> ());
let lines = List.rev !lines in
let stat = Unix.close_process_in chan in
- (match stat with
- | Unix.WEXITED 0 -> ()
- | Unix.WEXITED i ->
- error (f_"external command ‘%s’ exited with error %d") cmd i
- | Unix.WSIGNALED i ->
- error (f_"external co...
2015 Mar 18
0
[PATCH 1/2] mllib: allow external_command to return on nonzero return value
...* Run an external command, slurp up the output as a list of lines. *)
-let external_command ~prog cmd =
+let external_command ~prog ?(ignore_error = false) cmd =
let chan = Unix.open_process_in cmd in
let lines = ref [] in
(try while true do lines := input_line chan :: !lines done
with End_of_file -> ());
let lines = List.rev !lines in
let stat = Unix.close_process_in chan in
- (match stat with
- | Unix.WEXITED 0 -> ()
+ match stat with
+ | Unix.WEXITED 0 ->
+ (* Command exited correctly, return its output *)
+ lines
+ | Unix.WEXITED i when ignore_error ->
+ (...
2016 Oct 05
3
[PATCH v3 0/2] Improve OVA manifest parsing
This series fixes and enhances parsing of the OVA manifest file.
The changes are:
- Added mandatory space to the regexp
- Process all lines in the file, not just one
- Warn on improperly formated lines
- Support SHA256 hashes
v1 -> v2: rebased on to master to make use of the Checksums module
v2 -> v3:
- changed debug/warning messages in first patch according to Richard's
suggestions
2019 Jan 16
2
Re: [PATCH 2/5] mltools: create a new external_command_code
...or %d") cmd exitcode;
> + lines
> +
> +and external_command_code ?(echo_cmd = true) cmd =
> if echo_cmd then
> debug "%s" cmd;
> let chan = Unix.open_process_in cmd in
> @@ -347,18 +353,10 @@ let external_command ?(echo_cmd = true) cmd =
> with End_of_file -> ());
> let lines = List.rev !lines in
> let stat = Unix.close_process_in chan in
> - (match stat with
> - | Unix.WEXITED 0 -> ()
> - | Unix.WEXITED i ->
> - error (f_"external command ‘%s’ exited with error %d") cmd i
> - | Unix.WSIGNALED i -&...
2016 Oct 05
4
[PATCH v4 0/2] Improve OVA manifest parsing
This series fixes and enhances parsing of the OVA manifest file.
The changes are:
- Added mandatory space to the regexp
- Process all lines in the file, not just one
- Warn on improperly formated lines
- Support SHA256 hashes
v1 -> v2: rebased on to master to make use of the Checksums module
v2 -> v3:
- changed debug/warning messages in first patch according to Richard's
suggestions
2016 Dec 08
3
[PATCH 1/2] Remove most instances of OCaml warning 52.
...letters str 0 then
diff --git a/v2v/inspect_source.ml b/v2v/inspect_source.ml
index cf8c98f..ae9940d 100644
--- a/v2v/inspect_source.ml
+++ b/v2v/inspect_source.ml
@@ -120,7 +120,7 @@ and choose_root root_choice g = function
try i := int_of_string input
with
| End_of_file -> error (f_"connection closed")
- | Failure "int_of_string" -> ()
+ | Failure _ -> ()
)
done;
List.nth roots (!i - 1)
diff --git a/v2v/linux.ml b/v2v/linux.ml
index d449e10..729bb5d 100644
--- a/v2v/linux.ml
+++ b/v2v/...
2016 Jun 15
3
[PATCH 2/3] Convert source so it can be compiled with OCaml '-safe-string' option.
OCaml 4.02 introduced the 'bytes' type, a mutable string intended to
replace the existing 'string' type for those cases where the byte
array can be mutated. In future the 'string' type will become
immutable. This is not the default now, but it can be forced using
the '-safe-string' compile option.
I tested this on Fedora 24 (OCaml 4.02) & RHEL 7 (OCaml 4.01).
2005 Feb 19
1
Uniden UIP200, please help
...splay Disable
#User Agent Name Settings. Use Character "^" for space
UseCustomizedUserAgentName No
CustomizedUserAgentName
Uniden^Customized^UA
#Admin password must be numeric. Max is 6 digits.
Format: oldpassword/newpassword
#AdminPassword 1234/1111
#end_of_file
My uniden<mac>.txt (for 4.63):
# UIP200 Mass Configuration System Mac-based File
# Notes: Lines start with '#' are comments
# To leave a field value unchanged (as saved on local
phone), leave value to blank.
# To disable a field, use '-' as value
# MAXIMUM FILE SIZE IS 10...
2019 Jan 16
10
[PATCH 0/5] [RFC] builder: handle unavailable repos
In case a repository of virt-builder references files (e.g. the index)
that cannot be downloaded (network issues, 404, etc) then virt-builder
errors out on this situation. This is not a nice situation, from an user
POV.
This series does some refactoring to allow to better handle downloading
failures, and handle the failures gracefully in virt-builder.
RFC because I'm not yet too convinced