Skip to content

Commit

Permalink
Expose function to control buffering mode, do not change stderr by de…
Browse files Browse the repository at this point in the history
…fault
  • Loading branch information
nojb committed Jul 29, 2021
1 parent 5b34e82 commit a1422d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions stdlib/stdlib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,6 @@ let stdin = open_descriptor_in 0
let stdout = open_descriptor_out 1
let stderr = open_descriptor_out 2

let () =
set_channel_unbuffered stderr true

(* General output functions *)

type open_flag =
Expand Down
6 changes: 6 additions & 0 deletions stdlib/stdlib.mli
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,12 @@ val set_binary_mode_out : out_channel -> bool -> unit
This function has no effect under operating systems that
do not distinguish between text mode and binary mode. *)

val set_channel_unbuffered : out_channel -> bool -> unit
(** [set_channel_unbuffered oc true] sets the channel [oc] to
unbuffered mode: output will be visible as soon as the
function call returns.
@since 4.14.0 *)

(** {2 General input functions} *)

Expand Down

0 comments on commit a1422d1

Please sign in to comment.