+let write_ft uid ft =
+ let ft_ch = open_out (config_path () ^ "/ft_" ^ uid ^ ".dump") in
+ Marshal.to_channel ft_ch ft [];
+ close_out ft_ch;
+;;
+
+let read_ft uid =
+ try
+ let ft_ch = open_in (config_path () ^ "/ft_" ^ uid ^ ".dump") in
+ let ft = Marshal.from_channel ft_ch in
+ close_in ft_ch;
+ ft
+ with
+ | Sys_error _ ->
+ (* this is an error, we should rebuild the table by a diff of
+ the directory listing and svn stat *)
+ []
+;;
+
+let set_file_flag uid filename flag =
+ let ft = read_ft uid in
+ let oldflag =
+ try List.assoc filename ft
+ with Not_found -> MatitaFilesystem.MSynchronized
+ in
+ if oldflag <> MatitaFilesystem.MConflict
+ then
+ let ft = (filename,flag)::
+ List.filter (fun (fn,_) -> fn <> filename) ft in
+ write_ft uid ft
+ else ()
+;;
+