sig
module Kind :
sig
type t =
Char
| Fifo
| File
| Socket of [ `Active | `Bound | `Passive | `Unconnected ]
val infer_using_stat :
Core.Std.Unix.File_descr.t -> Fd.Kind.t Import.Deferred.t
end
type t
val info : Fd.t -> Core.Std.Info.t
val to_string : Fd.t -> string
val create :
Fd.Kind.t -> Core.Std.Unix.File_descr.t -> Core.Std.Info.t -> Fd.t
val kind : Fd.t -> Fd.Kind.t
val supports_nonblock : Fd.t -> bool
val close :
?should_close_file_descriptor:bool -> Fd.t -> unit Import.Deferred.t
val close_finished : Fd.t -> unit Import.Deferred.t
val is_closed : Fd.t -> bool
val with_close :
Fd.t -> f:(Fd.t -> 'a Import.Deferred.t) -> 'a Import.Deferred.t
val is_open : Fd.t -> bool
val stdin : unit -> Fd.t
val stdout : unit -> Fd.t
val stderr : unit -> Fd.t
val with_file_descr :
?nonblocking:bool ->
Fd.t ->
(Core.Std.Unix.File_descr.t -> 'a) ->
[ `Already_closed | `Error of exn | `Ok of 'a ]
val with_file_descr_exn :
?nonblocking:bool -> Fd.t -> (Core.Std.Unix.File_descr.t -> 'a) -> 'a
val with_file_descr_deferred :
Fd.t ->
(Core.Std.Unix.File_descr.t -> 'a Import.Deferred.t) ->
[ `Already_closed | `Error of exn | `Ok of 'a ] Import.Deferred.t
val ready_to_interruptible :
Fd.t ->
[ `Read | `Write ] ->
interrupt:unit Import.Deferred.t ->
[ `Bad_fd | `Closed | `Interrupted | `Ready ] Import.Deferred.t
val ready_to :
Fd.t ->
[ `Read | `Write ] -> [ `Bad_fd | `Closed | `Ready ] Import.Deferred.t
val syscall :
?nonblocking:bool ->
Fd.t ->
(Core.Std.Unix.File_descr.t -> 'a) ->
[ `Already_closed | `Error of exn | `Ok of 'a ]
val syscall_exn :
?nonblocking:bool -> Fd.t -> (Core.Std.Unix.File_descr.t -> 'a) -> 'a
val syscall_in_thread :
Fd.t ->
name:string ->
(Core.Std.Unix.File_descr.t -> 'a) ->
[ `Already_closed | `Error of exn | `Ok of 'a ] Import.Deferred.t
val syscall_in_thread_exn :
Fd.t ->
name:string -> (Core.Std.Unix.File_descr.t -> 'a) -> 'a Import.Deferred.t
val of_in_channel : Core.Std.In_channel.t -> Fd.Kind.t -> Fd.t
val of_out_channel : Core.Std.Out_channel.t -> Fd.Kind.t -> Fd.t
val of_in_channel_auto : Core.Std.In_channel.t -> Fd.t Import.Deferred.t
val of_out_channel_auto : Core.Std.Out_channel.t -> Fd.t Import.Deferred.t
val file_descr_exn : Fd.t -> Core.Std.Unix.File_descr.t
val to_int_exn : Fd.t -> int
val replace : Fd.t -> Fd.Kind.t -> Core.Std.Info.t -> unit
val sexp_of_t : Fd.t -> Sexplib.Sexp.t
end