mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 12:23:43 +01:00
Fixed read/write in qp_edit
This commit is contained in:
parent
a29c67a738
commit
00859876d5
@ -156,10 +156,10 @@ let create_temp_file ?filename ezfio_filename fields =
|
|||||||
let run check_only ?ndet ?state ?read ?write ezfio_filename =
|
let run check_only ?ndet ?state ?read ?write ezfio_filename =
|
||||||
|
|
||||||
(* Set check_only if the arguments are not empty *)
|
(* Set check_only if the arguments are not empty *)
|
||||||
let check_only =
|
let open_editor =
|
||||||
match ndet, state, read with
|
match ndet, state, read, write with
|
||||||
| None, None, None -> check_only
|
| None, None, None, None -> not check_only
|
||||||
| _ -> true
|
| _ -> false
|
||||||
in
|
in
|
||||||
|
|
||||||
(* Open EZFIO *)
|
(* Open EZFIO *)
|
||||||
@ -246,10 +246,7 @@ let run check_only ?ndet ?state ?read ?write ezfio_filename =
|
|||||||
in
|
in
|
||||||
|
|
||||||
|
|
||||||
let () =
|
if open_editor then
|
||||||
match check_only with
|
|
||||||
| true -> ()
|
|
||||||
| false ->
|
|
||||||
begin
|
begin
|
||||||
(* Open the temp file with external editor *)
|
(* Open the temp file with external editor *)
|
||||||
let editor =
|
let editor =
|
||||||
@ -258,8 +255,7 @@ let run check_only ?ndet ?state ?read ?write ezfio_filename =
|
|||||||
in
|
in
|
||||||
Printf.sprintf "%s %s" editor temp_filename
|
Printf.sprintf "%s %s" editor temp_filename
|
||||||
|> Sys.command |> ignore
|
|> Sys.command |> ignore
|
||||||
end
|
end;
|
||||||
in
|
|
||||||
|
|
||||||
if write = None then
|
if write = None then
|
||||||
(* Re-read the temp file *)
|
(* Re-read the temp file *)
|
||||||
|
Loading…
Reference in New Issue
Block a user