Module SequenceLabels.IO
val lines_of : ?mode:int -> ?flags:Pervasives.open_flag list -> string -> string tlines_of filenamereads all lines of the given file. It raises the same exception as would opening the file and read from it, except fromEnd_of_file(which is caught). The file is always properly closed. Every time the sequence is iterated on, the file is opened again, so different iterations might return different results- parameter mode
default
0o644
- parameter flags
default:
[Open_rdonly]
val chunks_of : ?mode:int -> ?flags:Pervasives.open_flag list -> ?size:int -> string -> string tRead chunks of the given
sizefrom the file. The last chunk might be smaller. Behaves likelines_ofregarding errors and options. Every time the sequence is iterated on, the file is opened again, so different iterations might return different results
val write_to : ?mode:int -> ?flags:Pervasives.open_flag list -> string -> string t -> unitwrite_to filename seqwrites all strings fromseqinto the given file. It takes care of opening and closing the file.- parameter mode
default
0o644
- parameter flags
used by
open_out_gen. Default:[Open_creat;Open_wronly].
val write_bytes_to : ?mode:int -> ?flags:Pervasives.open_flag list -> string -> Bytes.t t -> unit- since
- 0.5.4
val write_lines : ?mode:int -> ?flags:Pervasives.open_flag list -> string -> string t -> unitSame as
write_to, but intercales'\n'between each string
val write_bytes_lines : ?mode:int -> ?flags:Pervasives.open_flag list -> string -> Bytes.t t -> unit- since
- 0.5.4