1 let mapjoin f l
= (List.fold_left
(fun a b
-> a ^
(f b
)) "" l
)
2 let mapjoine e f
= function
4 | h
::t
-> (List.fold_left
(fun a b
-> a ^ e ^
(f b
)) (f h
) t
)
6 exception FileAlreadyExists
7 let open_out_unless_exists path
=
8 if Sys.file_exists path
9 then raise FileAlreadyExists
12 let run_in_other_directory tmppath cmd
=
13 let prevdir = Sys.getcwd
() in(
15 let retval = Sys.command cmd
in
16 (Sys.chdir
prevdir; retval)