Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dbm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ let iter f t =
walk (try Some(nextkey t) with Not_found -> None)
in
walk (try Some(firstkey t) with Not_found -> None)

let destroy fn =
Sys.remove (fn ^ ".dir");
Sys.remove (fn ^ ".pag")
4 changes: 4 additions & 0 deletions dbm.mli
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ val opendbm : string -> open_flag list -> int -> t
external close : t -> unit = "caml_dbm_close"
(** Close the given descriptor. *)

val destroy: string -> unit
(** [destroy fn] removes the underlying dbm files
[fn ^ ".pag"] and [fn ^ ".dir"]. *)

external find : t -> string -> string = "caml_dbm_fetch"
(** [find db key] returns the data associated with the given
[key] in the database opened for the descriptor [db].
Expand Down