Commit 6fa99f95 authored by erwan's avatar erwan

Change the behaviour of 'lutin -o somefile.rif'

It was avoiding to override the file somefile.rif by creating a
somefile-i.rif; but practice, it appears to be very cumbersome.
parent 3a7968f8
OASISFormat: 0.4
Name: Lutin
Version: 2.23
Version: 2.24
Authors: Erwan Jahier
Maintainers: erwan.jahier@imag.fr
License: PROP
......
......@@ -84,5 +84,4 @@ returns(x, y: real) =
node idiot (t:bool) returns(x,y:real) =
assert x = 10. in
run x,y := ivrogne(20., 20., 20., 20., 0., 100., 0., 200.)
\ No newline at end of file
......@@ -329,21 +329,21 @@ let (mkoptab : t -> unit) =
["-o"]
~arg:" <string>"
(Arg.String(function s ->
opt._outfile <- Some s;
let news = if not (Sys.file_exists s)
then s else
let rec find_free_name b i =
let f = Printf.sprintf "%s-%d.rif" b i in
if Sys.file_exists f then
find_free_name b (i+1)
else
f
in
find_free_name (Filename.chop_extension s) 1
in
if (Filename.check_suffix s ".rif") then (
opt._riffile <- Some news;
Luc2c.option.Luc2c.rif <- Some news
opt._outfile <- Some s;
(*let news = if not (Sys.file_exists s) *)
(* then s else *)
(* let rec find_free_name b i = *)
(* let f = Printf.sprintf "%s-%d.rif" b i in *)
(* if Sys.file_exists f then *)
(* find_free_name b (i+1) *)
(* else *)
(* f *)
(* in *)
(* find_free_name (Filename.chop_extension s) 1 *)
(* in *)
if (Filename.check_suffix s ".rif") then (
opt._riffile <- Some s;
Luc2c.option.Luc2c.rif <- Some s
)))
["output file name"]
;
......
let str="2.23"
let sha="7fc81dd"
let str="2.24"
let sha="3a7968f"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment