Channels are opened in binary mode iff binary
is true. This only has an effect on
Windows.
with_file ~f fname
executes ~f
on the open channel from
fname
, and closes it afterwards.
close t
closes t, and may raise an exception.
input_line ?fix_win_eol t
reads a line from t
and returns it, without
the newline ("
") character at the end, and, if fix_win_eol
the trailing
"
" is dropped.
fold_lines ?fix_win_eol t ~init ~f
folds over the lines read from t
using input_line
. Lines are provided to f
in the order they are
found in the file.
Completely reads an input channel and returns the results as a list of strings. Each line in one string.
iter_lines ?fix_win_eol t ~f
applies f
to each line read from t
using
input_line
.
same as Pervasives.set_binary_mode_in
, only applicable for Windows or Cygwin, no-op
otherwise