module Augeas:Augeas OCaml bindingssig
..end
type
t
exception Error of string
type
flag =
| |
AugSaveBackup |
(* | Rename original with .augsave | *) |
| |
AugSaveNewFile |
(* | Save changes to .augnew | *) |
| |
AugTypeCheck |
(* | Type-check lenses | *) |
Augeas.create
function.typepath =
string
Note in future we may replace this with a type-safe path constructor.
typevalue =
string
val create : string -> string option -> flag list -> t
create root loadpath flags
creates an Augeas handle.
root
is a file system path describing the location
of the configuration files.
loadpath
is an optional colon-separated list of directories
which are searched for schema definitions.
flags
is a list of flags.
val close : t -> unit
close handle
closes the handle.
You don't need to close handles explicitly with this function: they will be finalized eventually by the garbage collector. However calling this function frees up any resources used by the underlying Augeas library immediately.
Do not use the handle after closing it.
val get : t -> path -> value option
get t path
returns the value at path
, or None
if there
is no value.val exists : t -> path -> bool
exists t path
returns true iff there is a value at path
.val insert : t -> ?before:bool -> path -> string -> unit
insert t ?before path label
inserts label
as a sibling
of path
. By default it is inserted after path
, unless
~before:true
is specified.val rm : t -> path -> int
rm t path
removes all nodes matching path
.
Returns the number of nodes removed (which may be 0).
val matches : t -> path -> path list
matches t path
returns a list of path expressions
of all nodes matching path
.val count_matches : t -> path -> int
count_matches t path
counts the number of nodes matching
path
but does not return them (see Augeas.matches
).val save : t -> unit
save t
saves all pending changes to disk.