Module Styx__Types.Qid
A Qid is a unique identifier for a file. While any number of client-side identifiers (fids) can point to the same file, two files are the same if and only if they have the same Qid.
type t
type attr
=
val kind_set : t -> attr -> unit
kind_set qid attr
adds the referenced attribute toqid
. It does not remove any other existing attributes.
val kind_clear : t -> unit
kind_clear qid
clears all type attributes fromqid
. The resulting qid type is that of an ordinary file.
val version : t -> int
version q
is incremented whenever a file is changed. File systems may choose to use this field analagously to the POSIXctime
field. Synthetic files conventionally always have a version field of 0. Some clients may take this as a sign not to cache the contents of a file.
val version_set : t -> int -> unit
version_set qid v
sets the qid'sversion
field to v, overwriting the previous version.
val version_incr : t -> unit
version_incr qid
increments the qid'sversion
field by 1
val path : t -> int
path q
is a unique, 64-bit identifier for a file, analagous to an inode number of unix systems. This accessor should only be used if it is known that the path is no larger thanStdlib
.max_int (for example, if it can be proven that the qid value created by this library). Otherwise, thepath64
accessor should be used.
val path_set : t -> int -> unit
path_set qid
overwrites a qid'spath
field
val path64 : t -> int64
path64 q
retrieves the 64-bit path. Since a 64-bit path may not fit within anint
, this method should be used by clients and in other situations where it is not known if the high bits of a Qid path (beyondSys
.int_size) are set.
val of_iovec : Iovec.t -> t
of_iovec iov
convertsiov
to a Qid. No copying is done; the underlying buffer is still used to store the Qid contents.
val empty : t
empty
is an empty Qid, or a 13-byte string with all bytes set to0xFF
. It is used inTwstat
requests to indicate that the qid field should not be updated.
val write : w:Iovec.writer -> t -> Iovec.writer