Module Proto.Twalk

Twalk traverses the directory hierarchy from an existing file to another file up to max_welem path elements away.

The special file name ".." can be used in the argument list to refer to a file's parent. Upon successful completion of a Twalk request, newfid will refer to the final file in the path list. If a Twalk contains no path arguments, it functions as a way to duplicate a fid.

type t
val size : t -> int

The size of this message in bytes. It is identical to the length of the underlying I/O vector but is also encoded in the first 4 bytes of the message.

val code : int

The op code for this message.

val tag : t -> Tag.t

An identifier for this transaction. All in-flight requests on a given connection must have unique tags.

val of_iovec : Iovec.t -> t

of_iovec verifies a message from an I/O vector. No copying is done, and of_iovec only performs bounds checks. Modifying the underlying I/O vector will change the results when accessing message fields.

val fid : t -> Fid.t

fid is the parent directory from which to start the walk.

val newfid : t -> Fid.t

newfid will be associated with the final element of the walk, if successful.

val nwname : t -> int

nwelem is the number of elements being walked. It will be a number between 0 and max_welem

val fold_left : f:('a -> Iovec.t -> 'a) -> init:'a -> t -> 'a

fold_left ~f ~init m calls f on successive path elements in the Twalk request.

val write : Iovec.t -> tag:Tag.t -> fid:Fid.t -> newfid:Fid.t -> wname:string list -> int