module Utils: sig
.. end
Various utility functions.
val lines_of_string : string -> int
Returns the number of '\n' appearing in a string.
val output_filename_string : string option -> string
Returns string in option or "stdout" if None given.
val with_out_ch : string option -> (Pervasives.out_channel -> 'a) -> 'a
Open an output channel on given filename, gives it to the given function and
eventually closes the channel. stdout is used if no filename is given.
val with_in_ch : string option -> (Pervasives.in_channel -> 'a) -> 'a
Same as with_out_ch
for input channels (with stdin instead of stdout).