package protocol-9p

  1. Overview
  2. Docs
type extension = {
  1. extension : string;
    (*

    9P2000.u: extra information about links, pipes

    *)
  2. n_uid : int32;
    (*

    9P2000.u: numeric id of the user who owns the file

    *)
  3. n_gid : int32;
    (*

    9P2000.u: numeric id of the group of the file

    *)
  4. n_muid : int32;
    (*

    9P2000.u: numeric id of the user who last modified the file

    *)
}
include sig ... end
val extension_of_sexp : Sexplib.Sexp.t -> extension
val sexp_of_extension : extension -> Sexplib.Sexp.t
val make_extension : ?extension:string -> ?n_uid:int32 -> ?n_gid:int32 -> ?n_muid:int32 -> unit -> extension
type t = {
  1. ty : int;
    (*

    for kernel use

    *)
  2. dev : int32;
    (*

    for kernel use

    *)
  3. qid : Qid.t;
  4. mode : FileMode.t;
    (*

    permissions and flags

    *)
  5. atime : int32;
    (*

    last access time

    *)
  6. mtime : int32;
    (*

    last modification time

    *)
  7. length : int64;
    (*

    length of the file in bytes

    *)
  8. name : string;
    (*

    file name. Must be '/' if the file is the root

    *)
  9. uid : string;
    (*

    owner name

    *)
  10. gid : string;
    (*

    group name

    *)
  11. muid : string;
    (*

    name of last user who modified the file

    *)
  12. u : extension option;
    (*

    9P2000.u extensions

    *)
}
include sig ... end
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
val make : name:string -> qid:Qid.t -> ?mode:FileMode.t -> ?length:int64 -> ?atime:int32 -> ?mtime:int32 -> ?uid:string -> ?gid:string -> ?muid:string -> ?u:extension -> unit -> t
val sizeof : t -> int

The size of a buffer needed to hold t

val read : Cstruct.t -> (t * Cstruct.t, [ `Msg of string ]) Result.result

Read a t from the given buffer and return it, along with the unused remainder of the buffer. If the buffer cannot be parsed then return an error.

val write : t -> Cstruct.t -> (Cstruct.t, [ `Msg of string ]) Result.result

Write a t into the given buffer. If the buffer is too small, then return an error. Return the unused remainder of the buffer.