sig
exception Channel_closed of string
type 'mode channel
type input
type output
type 'a mode = Input : input mode | Output : output mode
val input : input mode
val output : output mode
type input_channel = input channel
type output_channel = output channel
val mode : 'a channel -> 'a mode
val stdin : input_channel
val stdout : output_channel
val stderr : output_channel
val zero : input_channel
val null : output_channel
val pipe :
?cloexec:bool ->
?in_buffer:Uwt_bytes.t ->
?out_buffer:Uwt_bytes.t -> unit -> input_channel * output_channel
val make :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) ->
?seek:(int64 -> Unix.seek_command -> int64 Lwt.t) ->
mode:'mode mode ->
(Uwt_bytes.t -> int -> int -> int Lwt.t) -> 'mode channel
val of_bytes : mode:'mode mode -> Uwt_bytes.t -> 'mode channel
val of_file :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) -> mode:'m mode -> Uwt.file -> 'm channel
val of_stream :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) -> mode:'m mode -> Uwt.Stream.t -> 'm channel
val of_pipe :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) -> mode:'m mode -> Uwt.Pipe.t -> 'm channel
val of_tcp :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) -> mode:'m mode -> Uwt.Tcp.t -> 'm channel
val close : 'a channel -> unit Lwt.t
val abort : 'a channel -> unit Lwt.t
val atomic : ('a channel -> 'b Lwt.t) -> 'a channel -> 'b Lwt.t
val file_length : string -> int64 Lwt.t
val buffered : 'a channel -> int
val flush : output_channel -> unit Lwt.t
val flush_all : unit -> unit Lwt.t
val buffer_size : 'a channel -> int
val resize_buffer : 'a channel -> int -> unit Lwt.t
val is_busy : 'a channel -> bool
val position : 'a channel -> int64
val set_position : 'a channel -> int64 -> unit Lwt.t
val length : 'a channel -> int64 Lwt.t
val read_char : input_channel -> char Lwt.t
val read_char_opt : input_channel -> char option Lwt.t
val read_chars : input_channel -> char Lwt_stream.t
val read_line : input_channel -> string Lwt.t
val read_line_opt : input_channel -> string option Lwt.t
val read_lines : input_channel -> string Lwt_stream.t
val read : ?count:int -> input_channel -> string Lwt.t
val read_into : input_channel -> Bytes.t -> int -> int -> int Lwt.t
val read_into_exactly :
input_channel -> Bytes.t -> int -> int -> unit Lwt.t
val read_value : input_channel -> 'a Lwt.t
val write_char : output_channel -> char -> unit Lwt.t
val write_chars : output_channel -> char Lwt_stream.t -> unit Lwt.t
val write : output_channel -> string -> unit Lwt.t
val write_line : output_channel -> string -> unit Lwt.t
val write_lines : output_channel -> string Lwt_stream.t -> unit Lwt.t
val write_from : output_channel -> Bytes.t -> int -> int -> int Lwt.t
val write_from_string : output_channel -> string -> int -> int -> int Lwt.t
val write_from_exactly :
output_channel -> Bytes.t -> int -> int -> unit Lwt.t
val write_from_string_exactly :
output_channel -> string -> int -> int -> unit Lwt.t
val write_value :
output_channel -> ?flags:Marshal.extern_flags list -> 'a -> unit Lwt.t
val fprint : output_channel -> string -> unit Lwt.t
val fprintl : output_channel -> string -> unit Lwt.t
val fprintf :
output_channel -> ('a, unit, string, unit Lwt.t) format4 -> 'a
val fprintlf :
output_channel -> ('a, unit, string, unit Lwt.t) format4 -> 'a
val print : string -> unit Lwt.t
val printl : string -> unit Lwt.t
val printf : ('a, unit, string, unit Lwt.t) format4 -> 'a
val printlf : ('a, unit, string, unit Lwt.t) format4 -> 'a
val eprint : string -> unit Lwt.t
val eprintl : string -> unit Lwt.t
val eprintf : ('a, unit, string, unit Lwt.t) format4 -> 'a
val eprintlf : ('a, unit, string, unit Lwt.t) format4 -> 'a
val hexdump_stream : output_channel -> char Lwt_stream.t -> unit Lwt.t
val hexdump : output_channel -> string -> unit Lwt.t
type file_name = string
val open_connection :
?in_buffer:Uwt_bytes.t ->
?out_buffer:Uwt_bytes.t ->
Unix.sockaddr -> (input_channel * output_channel) Lwt.t
val with_connection :
?in_buffer:Uwt_bytes.t ->
?out_buffer:Uwt_bytes.t ->
Unix.sockaddr -> (input_channel * output_channel -> 'a Lwt.t) -> 'a Lwt.t
type server
val establish_server_with_client_address :
?buffer_size:int ->
?backlog:int ->
?no_close:bool ->
Unix.sockaddr ->
(Unix.sockaddr -> input_channel * output_channel -> unit Lwt.t) ->
server Lwt.t
val establish_server :
?buffer_size:int ->
?backlog:int ->
?no_close:bool ->
Unix.sockaddr ->
(input_channel * output_channel -> unit Lwt.t) -> server Lwt.t
val shutdown_server : server -> unit Lwt.t
val lines_of_file : file_name -> string Lwt_stream.t
val lines_to_file : file_name -> string Lwt_stream.t -> unit Lwt.t
val chars_of_file : file_name -> char Lwt_stream.t
val chars_to_file : file_name -> char Lwt_stream.t -> unit Lwt.t
module type NumberIO =
sig
val read_int : input_channel -> int Lwt.t
val read_int16 : input_channel -> int Lwt.t
val read_int32 : input_channel -> int32 Lwt.t
val read_int64 : input_channel -> int64 Lwt.t
val read_float32 : input_channel -> float Lwt.t
val read_float64 : input_channel -> float Lwt.t
val write_int : output_channel -> int -> unit Lwt.t
val write_int16 : output_channel -> int -> unit Lwt.t
val write_int32 : output_channel -> int32 -> unit Lwt.t
val write_int64 : output_channel -> int64 -> unit Lwt.t
val write_float32 : output_channel -> float -> unit Lwt.t
val write_float64 : output_channel -> float -> unit Lwt.t
end
module LE : NumberIO
module BE : NumberIO
val read_int : input_channel -> int Lwt.t
val read_int16 : input_channel -> int Lwt.t
val read_int32 : input_channel -> int32 Lwt.t
val read_int64 : input_channel -> int64 Lwt.t
val read_float32 : input_channel -> float Lwt.t
val read_float64 : input_channel -> float Lwt.t
val write_int : output_channel -> int -> unit Lwt.t
val write_int16 : output_channel -> int -> unit Lwt.t
val write_int32 : output_channel -> int32 -> unit Lwt.t
val write_int64 : output_channel -> int64 -> unit Lwt.t
val write_float32 : output_channel -> float -> unit Lwt.t
val write_float64 : output_channel -> float -> unit Lwt.t
type byte_order = Little_endian | Big_endian
val system_byte_order : byte_order
val block :
'a channel -> int -> (Uwt_bytes.t -> int -> 'b Lwt.t) -> 'b Lwt.t
type direct_access = {
da_buffer : Uwt_bytes.t;
mutable da_ptr : int;
mutable da_max : int;
da_perform : unit -> int Lwt.t;
}
val direct_access : 'a channel -> (direct_access -> 'b Lwt.t) -> 'b Lwt.t
val default_buffer_size : unit -> int
val set_default_buffer_size : int -> unit
val open_file :
?buffer:Lwt_bytes.t ->
?flags:Unix.open_flag list ->
?perm:Unix.file_perm -> mode:'a mode -> file_name -> 'a channel Lwt.t
val with_file :
?buffer:Lwt_bytes.t ->
?flags:Unix.open_flag list ->
?perm:Unix.file_perm ->
mode:'a mode -> file_name -> ('a channel -> 'b Lwt.t) -> 'b Lwt.t
val open_temp_file :
?buffer:Lwt_bytes.t ->
?flags:Unix.open_flag list ->
?perm:Unix.file_perm ->
?temp_dir:string ->
?prefix:string -> unit -> (string * output_channel) Lwt.t
val with_temp_file :
?buffer:Lwt_bytes.t ->
?flags:Unix.open_flag list ->
?perm:Unix.file_perm ->
?temp_dir:string ->
?prefix:string -> (string * output_channel -> 'b Lwt.t) -> 'b Lwt.t
end