search for: close_in

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

2011 Aug 31
0
How can I use preprocessor standalone with a wav file?
...; #endif #include <speex/speex_preprocess.h> #include <stdio.h> #define NN 440 int main() { short in[NN]; int i; SpeexPreprocessState *st; int count=0; float f; char *inFile = "C:\\Temp\\in.wav"; //.wav file containing only pcm data, no header info int close_in=0; char *outFile= "C:\\Temp\\out.wav"; FILE *fin, *fout=NULL; fin = fopen(inFile, "rb"); if (!fin) { perror(inFile); exit(1); } close_in=1; fout = fopen(outFile, "wb"); if (!fout) { perror(outFile); i...
2017 Nov 05
3
[PATCH 1/2] common/mlstdutils: Add with_open_in and with_open_out functions.
...n/mlstdutils/std_utils.ml +++ b/common/mlstdutils/std_utils.ml @@ -654,20 +654,29 @@ let verbose = ref false let set_verbose () = verbose := true let verbose () = !verbose +let with_open_in filename f = + let chan = open_in filename in + protect ~f:(fun () -> f chan) ~finally:(fun () -> close_in chan) + +let with_open_out filename f = + let chan = open_out filename in + protect ~f:(fun () -> f chan) ~finally:(fun () -> close_out chan) + let read_whole_file path = let buf = Buffer.create 16384 in - let chan = open_in path in - let maxlen = 16384 in - let b = Bytes.create maxl...
2018 Dec 03
4
[supermin PATCH 0/2] Create a really empty base.tar.gz
See patch #2 for more explanation. Pino Toscano (2): prepare: keep config_files available for longer prepare: create a really empty base.tar.gz with no config files src/mode_prepare.ml | 87 +++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 35 deletions(-) -- 2.17.2
2018 Dec 03
0
[supermin PATCH 1/2] prepare: keep config_files available for longer
...function - | { ft_config = true; ft_path = path } -> Some path - | { ft_config = false } -> None - ) files - ) packages in - let config_files = List.flatten config_files in - - let config_files = List.filter ( - fun path -> - try close_in (open_in (dir // path)); true - with Sys_error _ -> false - ) config_files in + let config_files = + List.map ( + fun (_, files) -> + filter_map ( + function + | { ft_config = true; ft_path = path } -> Some path + | { ft_config = false }...
2015 Jul 17
0
[PATCH 1/2] mllib: add and use read_first_line_from_file
...cked = false } @@ -71,12 +71,6 @@ and parse_selector_list orig_arg = function | _ -> error (f_"invalid password selector '%s'; see the man page") orig_arg -and read_password_from_file filename = - let chan = open_in filename in - let password = input_line chan in - close_in chan; - password - (* Permissible characters in a salt. *) let chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./" diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 083c5d5..f9e8996 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @...
2016 Apr 05
1
Re: [PATCH 3/7] customize: add support for pvvxsvc
...> + let services = ["rhsrvany.exe"; "pvvxsvc.exe"] in > + let srvany = ( > + try > + List.find ( > + fun service -> ( > + try > + let chan = open_in (virt_tools_data_dir // service) in > + close_in chan; > + true > + with _ -> > + false > + ) > + ) services > + with Not_found -> > + error (f_"One of rhsrvany.exe or pvvxsvc.exe is missing in %s. One of them is required in order to install Windows f...
2014 Jun 03
2
Re: libguestfs supermin error
Hi Rich But there is no src/kernel.ml file on my ubuntu powerpc to which the above patch is reffering. I have installed supermin as supermin_5.1.8-2_powerpc.deb debian package. Thanks On Tue, Jun 3, 2014 at 7:16 PM, Richard W.M. Jones <rjones@redhat.com> wrote: > On Tue, Jun 03, 2014 at 06:55:49PM +0530, abhishek jain wrote: > > supermin: failed to find a suitable kernel
2016 Sep 29
3
[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 -- 2.10.0
2014 Jun 04
2
Re: libguestfs supermin error
...0x200) string >\0 version %s, > * > * Bugs: probably limited to x86 kernels. > *) > and get_kernel_version_from_file file = > try > let chan = open_in file in > let buf = read_string chan 514 4 in > if buf <> "HdrS" then ( > close_in chan; > raise Not_found > ); > let s = read_leshort chan 518 in > if s < 0x1ff then ( > close_in chan; > raise Not_found > ); > let offset = read_leshort chan 526 in > if offset < 0 then ( > close_in chan; >...
2016 May 12
0
[PATCH 05/11] customize: add support for pvvxsvc
....exe must exist. + (* either rhsrvany.exe or pvvxsvc.exe must exist. * * (Check also that it's not a dangling symlink but a real file). *) - let rhsrvany_exe = virt_tools_data_dir // "rhsrvany.exe" in - (try - let chan = open_in rhsrvany_exe in - close_in chan - with - Sys_error msg -> - error (f_"'%s' is missing. This file is required in order to install Windows firstboot scripts. You can get it by building rhsrvany (https://github.com/rwmjones/rhsrvany). Original error: %s") - rhsrvany_exe msg -...
2016 May 18
0
[PATCH v2 05/11] customize: add support for pvvxsvc
....exe must exist. + (* Either rhsrvany.exe or pvvxsvc.exe must exist. * * (Check also that it's not a dangling symlink but a real file). *) - let rhsrvany_exe = virt_tools_data_dir // "rhsrvany.exe" in - (try - let chan = open_in rhsrvany_exe in - close_in chan - with - Sys_error msg -> - error (f_"'%s' is missing. This file is required in order to install Windows firstboot scripts. You can get it by building rhsrvany (https://github.com/rwmjones/rhsrvany). Original error: %s") - rhsrvany_exe msg -...
2016 May 12
24
[PATCH 00/11] Getting it work with SLES / openSUSE
Hi there! I know it's been a while since I posted my first version of some patches. But here I have rebased them on top of Roman's work and added a few other ones. Cédric Bosdonnat (11): v2v: also search for windows virtio drivers in symlinks Update packagelist for SLES customize: fix windows firstboot script customize: change windows firstboot path customize: add support for
2015 Feb 10
1
[PATCH] php: add a simple bindtests test
...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/generator/main.ml +++ b/generator...
2016 May 12
0
[PATCH 07/11] v2v: add support for SUSE VMDP drivers
...hev_apt_exe = virt_tools_data_dir // "rhev-apt.exe" in - let rhev_apt_exe = + (* Check if either RHEV-APT or VMDP exists. This is optional. *) + let tools = ["rhev-apt.exe"; "vmdp.exe"] in + let installer = try - let chan = open_in rhev_apt_exe in - close_in chan; - Some rhev_apt_exe - with - Sys_error msg -> - warning (f_"'%s' is missing. Unable to install RHEV-APT (RHEV guest agent). Original error: %s") - rhev_apt_exe msg; - None in + let tool = List.find ( + fun item -> +...
2016 May 18
0
[PATCH v2 07/11] v2v: add support for SUSE VMDP drivers
...ools_data_dir // "rhev-apt.exe" in - let rhev_apt_exe = + (* Check if either RHEV-APT or VMDP exists. This is optional. *) + let tools = [`RhevApt, "rhev-apt.exe"; `VmdpExe, "vmdp.exe"] in + let installer = try - let chan = open_in rhev_apt_exe in - close_in chan; - Some rhev_apt_exe - with - Sys_error msg -> - warning (f_"'%s' is missing. Unable to install RHEV-APT (RHEV guest agent). Original error: %s") - rhev_apt_exe msg; - None in + let t, tool = List.find ( + fun (_, tool) -&g...
2018 Dec 03
4
[supermin PATCH v2 0/3] Better handle no config files
This is a "merge" of two previous series: https://www.redhat.com/archives/libguestfs/2018-December/msg00015.html https://www.redhat.com/archives/libguestfs/2018-December/msg00020.html The goal is to handle better situations like: - empty file in the appliance directory - no config files available in the packages to include in an appliance Compared to the two series, the changes are: -
2016 Apr 05
0
[PATCH 3/7] customize: add support for pvvxsvc
....exe must exist. + (* either rhsrvany.exe or pvvxsvc.exe must exist. * * (Check also that it's not a dangling symlink but a real file). *) - let rhsrvany_exe = virt_tools_data_dir // "rhsrvany.exe" in - (try - let chan = open_in rhsrvany_exe in - close_in chan - with - Sys_error msg -> - error (f_"'%s' is missing. This file is required in order to install Windows firstboot scripts. You can get it by building rhsrvany (https://github.com/rwmjones/rhsrvany). Original error: %s") - rhsrvany_exe msg -...
2016 Apr 05
0
[PATCH 7/7] v2v: add support for SUSE VMDP drivers
...hev_apt_exe = virt_tools_data_dir // "rhev-apt.exe" in - let rhev_apt_exe = + (* Check if either RHEV-APT or VMDP exists. This is optional. *) + let tools = ["rhev-apt.exe"; "vmdp.exe"] in + let installer = try - let chan = open_in rhev_apt_exe in - close_in chan; - Some rhev_apt_exe - with - Sys_error msg -> - warning (f_"'%s' is missing. Unable to install RHEV-APT (RHEV guest agent). Original error: %s") - rhev_apt_exe msg; - None in + let tool = List.find ( + fun item -> +...
2016 May 18
21
[PATCH v2 00/11] Getting it work with SLES / openSUSE
Hi all, v2 includes all comments from Pino and Richard. I also removed the mkdir /run/lvm in the init since it only failed in one case and couldn't reproduce it anymore. Cédric Bosdonnat (11): v2v: also search for windows virtio drivers in symlinks Update packagelist for SLES and openSUSE customize: fix windows firstboot script customize: change windows firstboot path customize:
2016 Sep 29
0
Re: [PATCH 1/2] v2v: ova: fix checking of the manifest file
...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