package datakit-client

  1. Overview
  2. Docs

A read-only tree of files, directories and symlinks.

type t
val read : t -> Datakit_path.t -> [ `File of Cstruct.t | `Dir of string list | `Link of string ] or_error Lwt.t

read t path is the contents of the object at the path.

val stat : t -> Datakit_path.t -> Datakit_S.stat option or_error Lwt.t

stat t path is the metadata of the object at path.

val exists : t -> Datakit_path.t -> bool or_error Lwt.t

exists t path is true if stat t path isn't None.

val exists_file : t -> Datakit_path.t -> bool or_error Lwt.t

exists_file t path is similar to exists but for files only.

val exists_dir : t -> Datakit_path.t -> bool or_error Lwt.t

exists_dir t path is similar to exists but for directories only.

val read_file : t -> Datakit_path.t -> Cstruct.t or_error Lwt.t

read_file t path resolves path to a file, or returns an error if it isn't a file.

val read_dir : t -> Datakit_path.t -> string list or_error Lwt.t

read_dir t path resolves path to a directory, or returns an error if it isn't one.

read_link t path resolves path to a symlink, or returns an error if it isn't one.

OCaml

Innovation. Community. Security.