ImageDisk images.
val make :
partition_scheme:partition_scheme ->
file_system:file_system ->
byte_size:int ->
name:string option ->
force:bool ->
make_path:bool ->
B0_std.Fpath.t ->
(unit, string) Stdlib.resultname maybe truncated depending on format.
val with_mount' :
image:B0_std.Fpath.t ->
(mount_root:B0_std.Fpath.t -> 'a) ->
('a, string) Stdlib.resultwith_mount ~image f tries to mount image in a temporary directory mount_root and hands it out to f for processing. The image is unmounted when f returns.
val with_mount :
image:B0_std.Fpath.t ->
(mount_root:B0_std.Fpath.t -> ('a, string) Stdlib.result) ->
('a, string) Stdlib.resultwith_mount' is like with_mount but it Result.joins the result of f.
cut_file p is Some (file, q) if file is an existing file on the file system and q the remaining path in p as an absolute path.
If p is exactly an existing file then the result is None. In this case p/ is Some (p, Fpath.root p.
The syntactic directoryness of p is kept in q.
val path_in_mount_to_image_path :
image:B0_std.Fpath.t ->
mount_root:B0_std.Fpath.t ->
B0_std.Fpath.t ->
B0_std.Fpath.tpath_in_mount_to_image_path ~image ~mount_root p drops mount_root from p and prepends image to id.
val get_existing_path_in_mount :
image:B0_std.Fpath.t ->
mount_root:B0_std.Fpath.t ->
B0_std.Fpath.t ->
(B0_std.Fpath.t, string) Stdlib.resultpath_in_mount_root ~image ~mount_root p checks that the absolute path p (usually obtained via cut_file) exists in mount_root, that it does not goes above the mount point mount_root and returns its path prepended by mount_root. This is not syntactic it's based on realpath.
image is the path to the image, it is used for reporting errors as if they originate from a sub path of this file.
val get_syntactic_path_in_mount :
image:B0_std.Fpath.t ->
mount_root:B0_std.Fpath.t ->
B0_std.Fpath.t ->
(B0_std.Fpath.t, string) Stdlib.resultensure_path_in_mount is like get_existing_path_in_mount execept the path may not exist.