package spotlib
Module Spotlib.File
Some simple file content iterations and /usr/bin/test style file status checking functions.
Iterators over lines
iter_lines_exn filename f iters f over lines of contets of filename.
Note: lines are obtained by input_line: therefore the newline chars are removed from the lines.
val iter_lines : string -> (string -> unit) -> (unit, [> `Exn of exn ]) resultiter_lines filename f iters f over lines of contets of filename.
Note: lines are obtained by input_line: therefore the newline chars are removed from the lines.
val to_lines : string -> (string list, [> `Exn of exn ]) resultto_lines filename returns the contens of the file.
Note: lines are obtained by input_line: therefore the newline chars are removed from the lines.
val to_string : string -> (string, [> `Exn of exn ]) resultto_string filename returns the contens of the file.
val open_out : string -> (out_channel -> 'a) -> 'aopen_out filename f opens filename then runs f over the opened channel. The channel is closed automatically no matter whether f terminates normally or raises an exception.
contains p1 p2 return Some compos when p2 is equal to p1 or under p1. compos is the directory components from p2 to reach p1.
If p1 is non existent, the search is performed only by comparison of path names. If p1 exists, the search is performed also with the file's inodes.
module Test : sig ... end/usr/bin/test like file testing