package stdcompat

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file stdcompat__out_channel.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

include Out_channel

(*
let output_bigarray _channel _src _pos _len =
  failwith "output_bigarray"

let is_binary_mode _channel =
  failwith "is_binary_mode"
*)
(*
type t = out_channel

type open_flag = Pervasives.open_flag =
    Open_rdonly
  | Open_wronly
  | Open_append
  | Open_creat
  | Open_trunc
  | Open_excl
  | Open_binary
  | Open_text
  | Open_nonblock

let stdout = stdout

let stderr = stderr

let open_bin = open_out_bin

let open_text = open_out

let open_gen = open_out_gen

let read_and_close channel f =
  Stdcompat__fun.protect
    ~finally:(fun () -> close_out_noerr channel)
    (fun () -> f channel)

let with_open_bin filename f =
  read_and_close (open_bin filename) f

let with_open_text filename f =
  read_and_close (open_text filename) f

let with_open_gen flags perm filename f =
  read_and_close (open_gen flags perm filename) f

let seek = LargeFile.seek_out

let pos = LargeFile.pos_out

let length = LargeFile.out_channel_length

let close = close_out

let close_noerr = close_out_noerr

let flush = flush

let flush_all = flush_all

let output_char = output_char

let output_byte = output_byte

let output_string = output_string

let output_bytes = Stdcompat__pervasives.output_bytes

let output = output

let output_substring = Stdcompat__pervasives.output_substring

let set_binary_mode = set_binary_mode_out

let set_buffered _ _ =
  failwith "Stdcompat.Out_channel.set_buffered is not implemented yet. Please fill an issue: https://github.com/thierry-martinez/stdcompat/issues ."

let is_buffered _ = true
*)

(*
let isatty _ic =
  failwith "not implemented"
*)
OCaml

Innovation. Community. Security.