Runtime.RuntimeEach command is wrapped in a value of type 'a t, making it possible to build runtimes wrapped in monads (for example, Git/Irmin, which are currently based on Lwt).
val runtime_error_to_string : runtime_error -> stringConverts a runtime error into a character string for diagnosis.
log level message log a message with a given message.
val get_time : unit -> int tget_time () returns the current timestamp.
file_exists ~on:source -> path returns true if the file exists, false otherwise.
val read_file :
on:[ `Source | `Target ] ->
Path.t ->
(string, runtime_error) result tread_file ~on:source -> path returns the content of a file.
val get_mtime :
on:[ `Source | `Target ] ->
Path.t ->
(int, runtime_error) result tget_mtime ~on:source path returns the modification time of a file.
val hash_content : string -> string thash_content str hash a content.
val create_directory :
on:[ `Source | `Target ] ->
Path.t ->
(unit, runtime_error) result tcreate_directory ~on path create a directory.
val write_file :
on:[ `Source | `Target ] ->
Path.t ->
string ->
(unit, runtime_error) result twrite_file ~on:source path content write a file.
is_directory ~on:source path returns true if the given path is a directory, false otherwise.
is_file ~on:source path returns true if the given path is a file, false otherwise.
val read_dir :
on:[ `Source | `Target ] ->
Path.t ->
(Path.fragment list, runtime_error) result tread_dir ~on:source path returns a list of filename (fragment) of a given directory.
val exec :
?is_success:(int -> bool) ->
string ->
string list ->
(string, runtime_error) result texec ?is_success prog ?args will executes prog ...args. When is_success is provided, it is called with the exit code to determine whether it indicates success or failure. Without is_success, success requires the process to return an exit code of 0.
printing on standard output is returned.