Module Tjr_minifs.In_mem
Construct an in-memory version of the filesystem ops; don't open
module Int_base_types = Minifs_intf.Int_base_types
Misc
module Map_int : sig ... end
module Set_string : sig ... end
module Map_string : sig ... end
val time : unit -> float
val mk_times : unit -> Minifs_intf.times
val fdata_ops : Tjr_lib.Tjr_buffer.buf Tjr_lib.Tjr_buffer.buf_ops
File and directory ids
module Fid : sig ... end
type fid
= Fid.fid
module Did : sig ... end
type did
= Did.did
Other basic types: dir_entry, file_times_and_data
module Symlink_type : sig ... end
module Dir_entry : sig ... end
type dir_entry
= Dir_entry.dir_entry
=
|
Fid of fid
|
Did of did
|
Symlink of Symlink_type.symlink
type file_times_and_data
=
{
times : Minifs_intf.Times.times;
data : Tjr_lib.Tjr_buffer.buf;
}
Dirs as maps from string
type dents_carrier
= dir_entry Map_string.t
type dents_ops
= (string, dir_entry, dents_carrier) Tjr_lib.Tjr_map.map_ops
module Dents_ops = Map_string
type dir_with_parent
=
{
name_map : dents_carrier;
times : Minifs_intf.Times.times;
parent : did;
}
val dir_empty : times:Minifs_intf.Times.times -> parent:did -> dir_with_parent
val dir_find : Dents_ops.key -> dir_with_parent -> dir_entry option
val dir_add : Dents_ops.key -> dir_entry -> dir_with_parent -> dir_with_parent
val dir_remove : Dents_ops.key -> dir_with_parent -> dir_with_parent
val dir_bindings : dir_with_parent -> (Dents_ops.key * dir_entry) list
val empty_dir : parent:did -> times:Minifs_intf.Times.times -> dir_with_parent
module Map_did : sig ... end
type dirs_carrier
= Map_did.t
type dirs_ops
= (did, dir_with_parent, dirs_carrier) Tjr_lib.Tjr_map.map_ops
val dirs_ops : dirs_ops
Global files map from fid
module Map_fid : sig ... end
type files_carrier
= Map_fid.t
type files_ops
= (fid, file_times_and_data, files_carrier) Tjr_lib.Tjr_map.map_ops
val files_ops : files_ops
Dir handles
type dhandles_carrier
= string list Map_int.t
type dhandles_ops
= (Int_base_types.dh, string list, dhandles_carrier) Tjr_lib.Tjr_map.map_ops
module Dhandles_ops = Map_int
Filesystem state
type fsys
=
{
files : files_carrier;
max_fid : fid;
dirs : dirs_carrier;
max_did : did;
dir_handles : dhandles_carrier;
max_dh : Int_base_types.dh;
}
module Fsys_to_json : sig ... end
val init_fsys : fsys
Extra monadic operations
type 't extra_ops
=
{
new_did : unit -> (did, 't) Tjr_monad.m;
new_fid : unit -> (fid, 't) Tjr_monad.m;
with_fs : a. (fsys -> 'a * fsys) -> ('a, 't) Tjr_monad.m;
internal_err : a. string -> ('a, 't) Tjr_monad.m;
dirs_add : did -> dir_with_parent -> (unit, 't) Tjr_monad.m;
is_ancestor : parent:did -> child:dir_with_parent -> (bool, 't) Tjr_monad.m;
}
Main functionality
val mk_ops : monad_ops:'t Tjr_monad.monad_ops -> extra_ops:'t extra_ops -> (fid, Dhandles_ops.key, 't) Minifs_intf.ops
State-passing instance FIXME tidy
type fsystem
=
{
internal_error_state : string option;
fsys : fsys;
}
Like fsys, but track any errors that occur, and maybe raise them from the monad
val init_fsystem : fsystem
val fsystem_to_string : fsystem -> string
type 't with_fs
=
{
with_fs : a. (fsys -> 'a * fsys) -> ('a, 't) Tjr_monad.m;
internal_err : a. string -> ('a, 't) Tjr_monad.m;
}
State-passing helper functions type; used to construct
extra_ops
val mk_extra_ops : monad_ops:'t Tjr_monad.monad_ops -> with_fs:'t with_fs -> 't extra_ops
val mk_ops : monad_ops:'t Tjr_monad.monad_ops -> with_fs:'t with_fs -> (fid, did, 't) Minifs_intf.ops
val in_mem_monad_ops : fsystem Tjr_monad.State_passing.state_passing Tjr_monad__.Monad_intf.monad_ops
val in_mem_state_passing_ops : (fid, did, fsystem Tjr_monad.state_passing) Minifs_intf.ops