2 Unix.file_descr list
->
3 Unix.file_descr list
->
4 Unix.file_descr list
->
6 (Unix.file_descr list
* Unix.file_descr list
* Unix.file_descr list
) Lwt.t
7 (** Drop-in replacement for [Unix.select] that works even when the Lwt main loop
8 is running (i.e. your function has [Lwt_main.run] somewhere higher up in the
11 The Lwt main loop is an event loop pumped by [Unix.select], and so regular
12 [Unix.select] calls are prone to raising `EINTR`. The implementation of this
13 function does not use [Unix.select] at all, but Lwt primitives that accomplish
17 module Process_success
: sig
25 module Process_failure
: sig
28 process_status
: Unix.process_status
;
34 val to_string
: t
-> string
42 (Process_success.t
, Process_failure.t
) Lwt_result.t
43 (** Run a command with a given input and return the output. If the command exits
44 with an exit status other than zero, raises [Process_failure] instead.
46 NOTE: on cancellation, this function will not kill the underlying process. (I
47 tried to implement it, but after killing the process, both [Lwt_io.close] and
48 [Lwt_io.abort] would hang when trying to close the process's
53 f
:(unit -> 'a
Lwt.t
) ->
54 finally
:(unit -> unit Lwt.t
) ->
56 (** Asynchronous version of [Utils.try_finally]. Run and wait for [f] to
57 complete, and be sure to invoke [finally] asynchronously afterward, even if [f]
58 raises an exception. *)
60 val read_all
: string -> (string, string) Lwt_result.t
61 (** Reads all the contents from the given file on disk, or returns an error
62 message if unable to do so. *)