Commit 74634462 authored by Stephane Glondu's avatar Stephane Glondu

Move file_exists to Web_common

parent 55b69623
......@@ -264,6 +264,13 @@ let extract_email =
with Not_found -> None
)
let file_exists x =
try%lwt
Lwt_unix.(access x [R_OK]) >>
return true
with _ ->
return false
let get_fname uuid x =
match uuid with
| None -> x
......
......@@ -107,6 +107,7 @@ val languages_of_string : string -> string list
val is_email : string -> bool
val extract_email : string -> string option
val file_exists : string -> bool Lwt.t
val read_file : ?uuid:uuid -> string -> string list option Lwt.t
val write_file : ?uuid:uuid -> string -> string list -> unit Lwt.t
......
......@@ -96,13 +96,6 @@ let () =
(** Parse configuration from other sources *)
let file_exists x =
try%lwt
Lwt_unix.(access x [R_OK]) >>
return true
with _ ->
return false
let%lwt source_file =
match !source_file with
| Some f ->
......
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