Make.File_system
type t = t
val load_file :
t ->
path:Fpath_sexp0.Absolute_path.t ->
(Vcs.File_contents.t, Vcs.Err.t) Stdlib.Result.t
Returns the contents of the file at the given path or an error if the file does not exist or is not readable.
val save_file :
?perms:int ->
t ->
path:Fpath_sexp0.Absolute_path.t ->
file_contents:Vcs.File_contents.t ->
(unit, Vcs.Err.t) Stdlib.Result.t
save_file
is expected to truncate the file if it already exists. Errors are reserved for other cases, such as trying to write to an non existing directory, not having write permissions, etc.
val read_dir :
t ->
dir:Fpath_sexp0.Absolute_path.t ->
(Fpath_sexp0.Fsegment.t list, Vcs.Err.t) Stdlib.Result.t
Returns the entries contained in the given directory, ordered increasingly according to String.compare
. This must error out if dir
is not a directory, or if we don't have access to it. The unix entries "." and ".." shall not be included in the result.