package protocol-9p
Module Make.LowLevelSource
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 allocate_fid :
t ->
(Protocol_9p__.Protocol_9p_types.Fid.t, [ `Msg of string ]) result Lwt.tallocate_fid t returns a free fid. Callers must call deallocate_fid t when they are finished with it.
deallocate_fid t fid clunks a fid and marks it as free for re-use.
val walk :
t ->
Protocol_9p__.Protocol_9p_types.Fid.t ->
Protocol_9p__.Protocol_9p_types.Fid.t ->
string list ->
(Protocol_9p__.Protocol_9p_response.Walk.t, [ `Msg of string ]) result Lwt.twalk t fid newfid wnames binds newfid to the result of Walking from fid along the path given by wnames
val openfid :
t ->
Protocol_9p__.Protocol_9p_types.Fid.t ->
Protocol_9p__.Protocol_9p_types.OpenMode.t ->
(Protocol_9p__.Protocol_9p_response.Open.t, [ `Msg of string ]) result Lwt.topen t fid mode confirms that fid can be accessed according to mode
val create :
t ->
Protocol_9p__.Protocol_9p_types.Fid.t ->
?extension:string ->
string ->
Protocol_9p__.Protocol_9p_types.FileMode.t ->
Protocol_9p__.Protocol_9p_types.OpenMode.t ->
(Protocol_9p__.Protocol_9p_response.Create.t, [ `Msg of string ]) result
Lwt.tcreate 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).
val stat :
t ->
Protocol_9p__.Protocol_9p_types.Fid.t ->
(Protocol_9p__.Protocol_9p_response.Stat.t, [ `Msg of string ]) result Lwt.tstat t fid returns a description of the file associated with fid
val wstat :
t ->
Protocol_9p__.Protocol_9p_types.Fid.t ->
Protocol_9p__.Protocol_9p_types.Stat.t ->
(unit, [ `Msg of string ]) result Lwt.twstat t fid stat changes the file metadata according to stat.
val read :
t ->
Protocol_9p__.Protocol_9p_types.Fid.t ->
int64 ->
int32 ->
(Protocol_9p__.Protocol_9p_response.Read.t, [ `Msg of string ]) result Lwt.tread 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__.Protocol_9p_types.Fid.t ->
int64 ->
Cstruct.t ->
(Protocol_9p__.Protocol_9p_response.Write.t, [ `Msg of string ]) result Lwt.twrite t fid offset data writes data to the file given by fid at offset offset. data must not exceed maximum_write_payload t.
val clunk :
t ->
Protocol_9p__.Protocol_9p_types.Fid.t ->
(unit, [ `Msg of string ]) result Lwt.tclunk 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.