package datakit-server

  1. Overview
  2. Docs

Directory operations.

type t

The type for directories.

val pp : t Fmt.t

pp is a pretty-printer for directories.

val ls : t -> Inode.t list or_err

The ls commands.

val mkfile : t -> ?perm:perm -> string -> Inode.t or_err

The mkfile command.

val lookup : t -> string -> Inode.t or_err

The lookup command.

val mkdir : t -> string -> Inode.t or_err

The mkdir command.

val remove : t -> unit or_err

The remove command. FIXME: shouldn't it be string -> unit?

val rename : t -> Inode.t -> string -> unit or_err

The rename command.

val empty : t

empty is the empty directory.

val of_list : (unit -> Inode.t list or_err) -> t

of_list l is a read-only, static directory containing only the inodes l. The sub-directories are re-evaluated on every ls and read.

val of_map_ref : Inode.t Astring.String.Map.t Pervasives.ref -> t

of_map_ref m is a read-only directory containing the inodes defined in m. The content of the directory is computed dynamically by accessing elements in the map on every access.

val read_only : ls:(unit -> Inode.t list or_err) -> lookup:(string -> Inode.t or_err) -> remove:(unit -> unit or_err) -> t

read_only is a read-only directory. FIXME.

val dir_only : ls:(unit -> Inode.t list or_err) -> lookup:(string -> Inode.t or_err) -> mkdir:(string -> Inode.t or_err) -> remove:(unit -> unit or_err) -> rename:(Inode.t -> string -> unit or_err) -> t

dir_only is a directory which contains only directories. FIXME.

val create : ls:(unit -> Inode.t list or_err) -> mkfile:(string -> perm -> Inode.t or_err) -> lookup:(string -> Inode.t or_err) -> mkdir:(string -> Inode.t or_err) -> remove:(unit -> unit or_err) -> rename:(Inode.t -> string -> unit or_err) -> t

creae is a generic directory.

val err_read_only : 'a or_err

Errors

val err_already_exists : 'a or_err
val err_dir_only : 'a or_err
val err_no_entry : 'a or_err
OCaml

Innovation. Community. Security.