(*
- * Copyright (C) 2000, HELM Team.
+ * Copyright (C) 2003:
+ * Stefano Zacchiroli <zack@cs.unibo.it>
+ * for the HELM Team http://helm.cs.unibo.it/
*
* This file is part of HELM, an Hypertextual, Electronic
* Library of Mathematics, developed at the Computer Science
* MA 02111-1307, USA.
*
* For details, see the HELM World-Wide-Web page,
- * http://cs.unibo.it/helm/.
+ * http://helm.cs.unibo.it/
*)
-let debug = true;;
-let debug_print s = if debug then prerr_endline s;;
-
exception Key_already_in of string;;
exception Key_not_found of string;;
val mutable db = open_dbm ()
- initializer Gc.finalise Dbm.close db (* close db on GC *)
+ (*initializer Gc.finalise Dbm.close db (* close db on GC *)*)
method add key value =
self#doWriter (lazy (
method clear =
self#doWriter (lazy (
Dbm.close db;
- Sys.remove (dbname ^ ".dir");
- Sys.remove (dbname ^ ".pag");
+ List.iter
+ (fun ext ->
+ let file = dbname ^ ext in
+ if Sys.file_exists file then Sys.remove file)
+ [".dir"; ".pag"; ".db"];
db <- open_dbm ()
))
+ method close =
+ self#doWriter (lazy (
+ Dbm.close db
+ ))
+
end