Module 1-FS.File

type error = error
type t = t
val exists : t -> Fpath.t -> (bool, error) Stdlib.result Lwt.t
val delete : t -> Fpath.t -> (unit, error) Stdlib.result Lwt.t
val move : t -> Fpath.t -> Fpath.t -> (unit, error) Stdlib.result Lwt.t

move should be be atomic

type 'a fd constraint 'a = [< `Read | `Write ]
val open_w : t -> Fpath.t -> ([ `Write ] fderror) Stdlib.result Lwt.t
val open_r : t -> Fpath.t -> ([ `Read ] fderror) Stdlib.result Lwt.t
val write : Cstruct.t -> ?⁠off:int -> ?⁠len:int -> [> `Write ] fd -> (int, error) Stdlib.result Lwt.t
val read : Cstruct.t -> ?⁠off:int -> ?⁠len:int -> [> `Read ] fd -> (int, error) Stdlib.result Lwt.t
val close : 'a fd -> (unit, error) Stdlib.result Lwt.t