package spotlib
Module Spotlib.XunixSource
Command invocation
val mkdir :
?perm:Unix.file_perm ->
?recursive:bool ->
string ->
(unit,
string
* [> `Unix of Unix.error
| `Already_exists of Unix.stats
| `Not_a_directory of Unix.stats ])
resultCreate a directory of the given name. Does nothing if the directory exists already.
Bug: No chmod if the directroy already exists.
Like mkdtemp(3). It must take a template whose postfix is "XXXXXX". It creates a new directory name by replacing "XXXXXX" by random number then creates a directory of permission 0o700
with_dtemp template f creates a temp directory dir using mkdtemp template then runs f dir. The temp directory dir is automatically removed (even if it is not empty) after f dir.
with_chdir ?at_failure dir f may raises an exception when:
at_failureraises an exception when the first chdir failure is reported to itf ()raises an exception- chdir back to the original directory fails (reported by
Exn.Finally)
with_dir dir f runs f with the dir_handle against dir
fold_dir dir init f runs f folding over the files under the directory dir, with the initial value init
timed_message mes f returns a function as same as f but with printing computation times to stderr.