protocol-9p
  1. Overview
  2. Docs
type permission = [
  1. | `Read
    (*

    subject has read access

    *)
  2. | `Write
    (*

    subject has write access

    *)
  3. | `Execute
    (*

    subject may execute the file as a program

    *)
]
val sexp_of_permission : permission -> Ppx_sexp_conv_lib.Sexp.t
val permission_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> permission
val __permission_of_sexp__ : Ppx_sexp_conv_lib.Sexp.t -> permission
type t = {
  1. owner : permission list;
    (*

    file owner has these permissions

    *)
  2. group : permission list;
    (*

    anyone in the same group has these permissions

    *)
  3. other : permission list;
    (*

    all other users have these permissions

    *)
  4. is_directory : bool;
    (*

    true if the file is a directory

    *)
  5. append_only : bool;
    (*

    true if the file is append-only (and therefore offsets in writes are ignored)

    *)
  6. exclusive : bool;
    (*

    true if only one client may have it open at a time

    *)
  7. is_mount : bool;
    (*

    true if the file is a mountpoint

    *)
  8. is_auth : bool;
    (*

    true if the file is a special authentication file

    *)
  9. temporary : bool;
    (*

    true if the file is temporary and should be skipped from nightly backups

    *)
  10. is_device : bool;
    (*

    9P2000.u: true if file is a char/block device

    *)
  11. is_namedpipe : bool;
    (*

    9P2000.u: true if file is a nomed pipe

    *)
  12. is_socket : bool;
    (*

    9P2000.u: true if file is a socket

    *)
  13. is_setuid : bool;
    (*

    9P2000.u: true if file is setuid

    *)
  14. is_setgid : bool;
    (*

    9P2000.u: true if file is setgid

    *)
  15. is_any : bool;
    (*

    true if the mode is a wstat 'any' value

    *)
}

A 'mode' returned from a call to "Stat"

include Ppx_sexp_conv_lib.Sexpable.S with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> t
val sexp_of_t : t -> Sexplib0.Sexp.t
val make : ?owner:permission list -> ?group:permission list -> ?other:permission list -> ?is_directory:bool -> ?append_only:bool -> ?exclusive:bool -> ?is_mount:bool -> ?is_auth:bool -> ?temporary:bool -> ?is_device:bool -> ?is_symlink:bool -> ?is_hardlink:bool -> ?is_namedpipe:bool -> ?is_socket:bool -> ?is_setuid:bool -> ?is_setgid:bool -> unit -> t
val any : t
val is_any : t -> bool
val nonet_of_permissions : t -> int32
val sizeof : t -> int

The size of a buffer needed to hold t

val read : Cstruct.t -> (t * Cstruct.t, [ `Msg of string ]) 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

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