Module GenClone.IO
val with_in : ?mode:int -> ?flags:Pervasives.open_flag list -> string -> (char t -> 'a) -> 'a
read filename f
opensfilename
and callsf g
, whereg
is a clonable generator of characters from the file. It can be cloned by callingg#save
(which saves the position in the file), and used withg#next
. Distinct clones ofg
shouldn't be used at the same time (otherwiseFailure _
will be raised). Both the generator and save points are only valid within the scope in whichf
is called.