Io
val (/) : [> Eio.Fs.dir_ty ] as 'a Eio.Path.t -> string -> 'a Eio.Path.t
val to_res : (unit -> 'a) -> ('a, string) result
to_res f
converts the result of function f
to a Result.t
type. It returns Ok (f ())
if f
executes successfully, and Error string
if an exception is raised.
val log : dir:Eio.Fs.dir_ty Eio.Path.t -> ?file:string -> string -> unit
log ~dir ?(file = "./logs.txt") s
appends the string s
to the log file file
in directory dir
. If the log file does not exist, it will be created with permissions 0o600.
val console_log : stdout:[> Eio.Flow.sink_ty ] Eio.Resource.t -> string -> unit
console_log ~stdout log
writes the string log
to the standard output stdout
.
val save_doc : dir:Eio.Fs.dir_ty Eio.Path.t -> string -> string -> unit
save_doc ~dir file p
saves the content of p
to the file file
in directory dir
. If the file does not exist, it will be created with permissions 0o777.
val append_doc : dir:Eio.Fs.dir_ty Eio.Path.t -> string -> string -> unit
append_doc ~dir file p
appends the content of p
to the file file
in directory dir
. If the file does not exist, it will be created with permissions 0o777.
val load_doc : dir:Eio.Fs.dir_ty Eio.Path.t -> string -> string
load_doc ~dir file
loads the content of the file file
in directory dir
and returns it.
val delete_doc : dir:Eio.Fs.dir_ty Eio.Path.t -> string -> unit
delete_doc ~dir file
deletes the file file
in directory dir
.
val mkdir : ?exists_ok:bool -> dir:Eio.Fs.dir_ty Eio.Path.t -> string -> unit
mkdir ~dir path
creates a directory at the given path
in directory dir
.
val directory : dir:Eio.Fs.dir_ty Eio.Path.t -> string -> string list
directory ~dir path
reads the directory at the given path
and returns a string list of all the file and path names in the directory
val is_dir : dir:Eio.Fs.dir_ty Eio.Path.t -> string -> bool
is_dir ~dir path
checks if the given path
in directory dir
is a directory and returns a boolean value.
val with_dir :
dir:[> Eio.Fs.dir_ty ] Eio.Path.t ->
([ `Close | `Dir ] Eio.Path.t -> 'a) ->
'a
with_dir ~dir f
opens the directory dir
and applies the function f
to it.
module Net : sig ... end
module type Task_pool_config = sig ... end
module Task_pool (C : Task_pool_config) : sig ... end
Task_pool
is a functor that creates a task pool with the given configuration.
val run_main : (Eio_unix.Stdenv.base -> 'a) -> 'a
run_main f
runs the main function f
with the Eio environment.
module Server : sig ... end
module Client : sig ... end
module Run_server : sig ... end
module Base64 : sig ... end