Page
Library
Module
Module type
Parameter
Class
Class type
Source
Vfs.FileSourceFile operations.
The type for open files, e.g. file descriptors.
val create_fd :
read:(offset:int64 -> count:int -> Cstruct.t or_err) ->
write:(offset:int64 -> Cstruct.t -> unit or_err) ->
fdCreate an open file object.
read f ~offset ~count reads an open file.
write f ~offset writes in a open file.
The type for files.
val create :
stat:(unit -> metadata or_err) ->
open_:(unit -> fd or_err) ->
remove:(unit -> unit or_err) ->
truncate:(int64 -> unit or_err) ->
chmod:(perm -> unit or_err) ->
tcreate is the file t such that FIXME.
truncate t len sets the length of t to len. If the new length is shorter, the file is truncated. If longer, it is padded with zeroes.
rw_of_string init is a mutable file that initially contains init and a function which can be called to get the current contents.
status f is the file containing the result of f. f is evaluated everytime the file is open. If length is not set, f will also be called during stat queries.
command ?init f is the file containing the result of f. f is evaluated on every write, with the contents of the file as argument. Initially the file contains init.
val of_kv :
read:(unit -> Cstruct.t option or_err) ->
write:(Cstruct.t -> unit or_err) ->
stat:(unit -> metadata or_err) ->
remove:(unit -> unit or_err) ->
chmod:(perm -> unit or_err) ->
tof_kv ~read ~write ~remove ~stat interprets values from a k/v store as files. Handles reading and writing regions of the file.
of_kvro is similar to of_kv but for read-only values.
stat_of ~read makes a stat function from read. The function reads the file to get the length, and reports the type as `Normal.
of_stream s is the file which will be, once opened, similar to the stream s ().