diff --git a/lib/unix_handling.ml b/lib/unix_handling.ml new file mode 100644 index 0000000..738bbfd --- /dev/null +++ b/lib/unix_handling.ml @@ -0,0 +1,17 @@ +let run_cmd args = + let lines = ref [] in + let cmd = String.concat " " args in + Printf.printf "Cmd: %s\n" cmd; + flush stdout; + let inp = Unix.open_process_in cmd in + try + while true do + lines := (input_line inp) :: !lines + done; + (*!lines*) + () + + with End_of_file -> + let _ = Unix.close_process_in inp in + (*!lines*) + ()