Checking in daemonization, writing to a logfile, and saving the pid
[vsys.git] / conffile.ml
1 open Printf
2 open Globals
3 open Scanf
4
5 let split_conf_line s =
6   sscanf s "%s %s" (fun s1 s2->(s1,s2))
7
8 let read_frontends f =
9   let f_file = try open_in f with e -> fprintf logfd "Could not open config file\n";flush logfd;raise e
10   in
11   let rec read_conf_file cur_list =
12     let next_line = try Some(input_line f_file) with _ -> None in
13       match next_line with
14         | Some(inp_line) -> read_conf_file (split_conf_line(inp_line)::cur_list)
15         | None -> cur_list
16   in
17     read_conf_file []