package datakit-client

  1. Overview
  2. Docs

The functions in this module are mapped directly onto individual 9P RPCs. The client must carefully respect the rules on managing fids and stay within the message size limits.

val maximum_write_payload : t -> int32

The largest payload that can be written in one go.

val allocate_fid : t -> Protocol_9p_types.Fid.t Protocol_9p_error.t Lwt.t

allocate_fid t returns a free fid. Callers must call deallocate_fid t when they are finished with it.

val deallocate_fid : t -> Protocol_9p_types.Fid.t -> unit Lwt.t

deallocate_fid t fid clunks a fid and marks it as free for re-use.

walk t fid newfid wnames binds newfid to the result of Walking from fid along the path given by wnames

open t fid mode confirms that fid can be accessed according to mode

create t fid name perm mode creates a new file or directory called name and with permissions perm inside the directory fid and opens it according to mode (which is not checked against perm).

stat t fid returns a description of the file associated with fid

wstat t fid stat changes the file metadata according to stat.

read t fid offset count returns count bytes of data at offset in the file referenced by pid. Note that count must be less than the server's negotiated maximum message size.

val write : t -> Protocol_9p_types.Fid.t -> int64 -> Cstruct.t -> Protocol_9p_response.Write.t Protocol_9p_error.t Lwt.t

write t fid offset data writes data to the file given by fid at offset offset. data must not exceed maximum_write_payload t.

clunk t fid informs the server that the reference fid should be forgotten about. When this call returns, it is safe for the client to re-use the fid.

remove t fid removes the file associated with fid from the file server. The server will "clunk" the fid whether the call succeeds or fails.

val update : t -> ?name:string -> ?length:int64 -> ?mode:Protocol_9p_types.FileMode.t -> ?mtime:int32 -> ?gid:string -> Protocol_9p_types.Fid.t -> unit Protocol_9p_error.t Lwt.t

Convenience wrapper around wstat.

OCaml

Innovation. Community. Security.