5.!*55.5.0+dev0-2025-04-28/+Out_channel!tA;@@@A&Stdlib+out_channel@@@@@@@<../../stdlib/out_channel.mli\uu\u@@@@+Out_channel@@A@)open_flagB;@@+Open_rdonly@@``@@B@+Open_wronly@@aa@@C@+Open_append@@#b.0$b.=@@"D@*Open_creat@@,c{}-c{@@+E@*Open_trunc@@5d6d@@4F@)Open_excl@@>e?e @@=G@+Open_binary@@GfJLHfJY@@FH@)Open_text@@PgQg@@OI@-Open_nonblock@@YhZh@@XJ@@@A&Stdlib)open_flag@@@@@@@f_ @@A@dA@A@&stdout+Out_channel!t@@@@vk22wk2@@@uK@@&stderr+Out_channel!t@@@@nnnnn|@@L@@(open_bin@&string@@@+Out_channel!t@@@@@@qq@@M@@)open_text @@@@+Out_channel!t@@@@@@v  v  @@N@@(open_gen!@$list+Out_channel)open_flag@@@@@@@#int@@@@J@@@+Out_channel!t@@@@@@@@@@|  |  @@O@@-with_open_bin"@b@@@@@+Out_channel!t@@@!a@C@@@@@@@@ C H H C H u@@ P@@.with_open_text#@@@@@@+Out_channel!t@@@!a@C@@@@@@@@-H 5 5.H 5 c@@,Q@@-with_open_gen$@uà+Out_channel)open_flag@@@@@@@t@@@@@@@@@+Out_channel!t@@@!a@C@@@@@@@@@@@@fL  gL @@eR@@%close%@+Out_channel!t@@@$unit@@@@@@PP@@~S@@+close_noerr&@+Out_channel!t@@@@@@@@@W..W.I@@T@@+output_char'@+Out_channel!t@@@@$char@@@9@@@@@@@@\\@@U@@+output_byte(@+Out_channel!t@@@@@@@X@@@@@@@@__@@V@@-output_string)@+Out_channel!t@@@@Y@@@w@@@@@@@@cc@@W@@,output_bytes*@+Out_channel!t@@@@%bytes@@@@@@@@@@@ff)@@X@@&output+@+Out_channel!t@@@@ @@@@]@@@@d@@@@@@@@@@@@ @@ @BkCk@@AY@@0output_substring,@+Out_channel!t@@@ @@@@ @@@@ @@@@@@@@@@@@@@@@orpr@@nZ@@/output_bigarray@+Out_channel!t@@@@&Stdlib(Bigarray&Array1!t@@ &Stdlib(Bigarray1int8_unsigned_elt@@@ &Stdlib(Bigarray(c_layout@@@ @@@ @@@@ @@@@ >@@@ @@ @@ @@ @@ @vAAx@@[@@%flush@+Out_channel!t@@@ V@@@ @@ @~%%~%:@@\@@)flush_all@f@@@ k@@@ @@ @   <@@]@@$seek@+Out_channel!t@@@ @%int64@@@ @@@ @@ @@ @  @@^@@#pos@+Out_channel!t@@@ @@@ @@ @!"@@ _@@&length@+Out_channel!t@@@ 6@@@ @@ @9:@@8`@@/set_binary_mode@+Out_channel!t@@@ @$bool@@@ @@@ @@ !@@ "@YZ@@Xa@@.is_binary_mode@+Out_channel!t@@@ #@@@ $@@ %@qr@@pb@@,set_buffered@+Out_channel!t@@@ &@8@@@ '@@@ (@@ )@@ *@XXX|@@c@@+is_buffered@+Out_channel!t@@@ +U@@@ ,@@ -@yyy@@d@@&isatty@+Out_channel!t@@@ .m@@@ /@@ 0@ @@e@@@30Output channels.@ This module provides functions for working with output channels. For example, you can use this module to write to a file or print to the terminal.@) See 4Out_channel.examples(Examples@4 the example section@' below.@@@@$4.14@@@@@@@A<../../stdlib/out_channel.mliA(channels(Channels@@#-Out_channel.t3;The type of output channel.@@@@@@@@@@@@@@A@@@#5Out_channel.open_flag32Opening modes for 4Out_channel.open_genD@!.@@@@@@@@@@@@@@@31open for reading.@@@@@@@@@@@@@@31open for writing.@@@@@@@@@@@@@@3 0open for appending: always write at end of file.@@@@@@@@@@@@@@3 %create the file if it does not exist.@@@@@@@@@@@@@@3 $empty the file if it already exists.@@@@@@@@@@@@@@3 /fail if Open_creat and the file already exists.@@@@@@@@@@@@@@3 $open in binary mode (no conversion).@@@@@@@@@@@@@@3 ,open in text mode (may perform conversions).@@@@@@@@@@@@@@3:open in non-blocking mode.@@@@@@@@@@@@@A@ @@2Out_channel.stdout3 $The standard output for the process.@@@@@@@@@@@@@@@@2Out_channel.stderr3 *The standard error output for the process.@@@@@@@@@@@@@@@@4Out_channel.open_bin3 Open the named file for writing, and return a new output channel on that file, positioned at the beginning of the file. The file is truncated to zero length if it already exists. It is created if it does not already exists.@@@@@@@@@@@@@ @@@@5Out_channel.open_text3(Same as D@ , but the file is opened in text mode, so that newline translation takes place during writes. On operating systems that do not distinguish between text mode and binary mode, this function behaves like D@!.@@@@@@@@@@@@@@@@@3;open_gen mode perm filename N opens the named file for writing, as described above. The extra argument $mode 4 specifies the opening mode. The extra argument $perm H specifies the file permissions, in case the file must be created. 2D@% and HD@ ( are special cases of this function.@@@@@@@@@@@@ @E @H@K@@@@9Out_channel.with_open_bin32with_open_bin fn f1 opens a channel "oc) on file "fn- and returns (f oc(. After !f : returns, either with a value or by raising an exception, "oc is guaranteed to be closed.@@@@@@@@@@@@@{@~ @@@@:Out_channel.with_open_text3%Like , to the given output channel "oc!.@@@@@@@@0Invalid_argument#if #pos% and #len ' do not designate a valid range of #buf!.@@@@@@ @@@@@@@ but take a string as argument instead of a byte sequence.@@@@@@@@@@@@@@@@@@@@㠕;Out_channel.output_bigarray3(Same as rD@ # but take the data from a bigarray.@@@@#5.2@@@@@@@@@@@@@@@A(flushing(Flushing@@3 Flush the buffer associated with the given output channel, performing all pending writes on that channel. Interactive programs must be careful about flushing standard output and standard error at the right time.@@@@@@@@@@@@@@@@@5Out_channel.flush_all3 .Flush all open output channels; ignore errors.@@@@@@@@@@@@@ @@@@A'seeking'Seeking@@0Out_channel.seek3-seek chan pos & sets the current writing position to #pos1 for channel $chan . This works only for regular files. On files of other kinds (such as terminals, pipes and sockets), the behavior is unspecified.@@@@@@@@@@@@@3@6@@@@/Out_channel.pos3 jReturn the current writing position for the given channel. Does not work on channels opened with the +Open_append $ flag (returns unspecified results).@ For files opened in text mode under Windows, the returned position is approximate (owing to end-of-line conversion); in particular, saving the current position with D@ ), then going back to this position using :D@ z will not work. For this programming idiom to work reliably and portably, the file must be opened in binary mode.@@@@@@@@@@@@@[@@@@ƠA*attributes*Attributes@@2Out_channel.length3 Return the size (number of characters) of the regular file on which the given channel is opened. If the channel is opened on a file that is not a regular file, the result is meaningless.@@@@@@@@@@@@@s@@@@Ơ;Out_channel.set_binary_mode37set_binary_mode oc true2 sets the channel "oc > to binary mode: no translations take place during output.@% 8set_binary_mode oc false2 sets the channel "oc to text mode: depending on the operating system, some translations may take place during output. For instance, under Windows, end-of-lines will be translated from "\n( to $\r\n!.@ w This function has no effect under operating systems that do not distinguish between text mode and binary mode.@@@@@@@@@@@@@@@@@@᠕:Out_channel.is_binary_mode31is_binary_mode oc= returns whether the channel "oc< is in binary mode (see MD@").@@@@#5.2@@@@@@@@@@@@頕8Out_channel.set_buffered34set_buffered oc true2 sets the channel "oc$ to (buffered@ ( mode. In this mode, data output on "oc O will be buffered until either the internal buffer is full or the function D@$ or D@ D is called, at which point it will be sent to the output device.@% 5set_buffered oc false2 sets the channel "oc$ to *unbuffered@ ( mode. In this mode, data output on "oc 3 will be sent to the output device immediately.@> All channels are open in (buffered@1 mode by default.@@@@@@@@@@@@7@*8@-1@@@@)7Out_channel.is_buffered3.is_buffered oc= returns whether the channel "oc6 is buffered (see qD@").@@@@@@@@@@@@9@K:@@@@/2Out_channel.isatty3)isatty oc$ is $true$ if "oc - refers to a terminal or console window, %false+ otherwise.@@@@#5.1@@@@@@@G@qH@@@@=A(examples,@ # Printing to the terminal: G Out_channel.output_string Out_channel.stdout "hello, world" @ ) Writing the contents of a file: let write_file file s = Out_channel.with_open_bin file (fun oc -> Out_channel.output_string oc s)) @@@2@@A&Stdlib(Bigarray@@@@@