Spotlib.FileSourceSome simple file content iterations and /usr/bin/test style file status checking functions.
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.
iter_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.
to_lines filename returns the contens of the file.
Note: lines are obtained by input_line: therefore the newline chars are removed from the lines.
to_string filename returns the contens of the file.
open_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.
Get file inode. Works for Unix and MinGW. Cygwin? Never tried.
Check two file names share the same inode
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.