Error handling
type 'a result = ('a, [ `Unix of Unix.error ]) Result.resultThe type for Unix results.
val pp_error : Stdlib.Format.formatter -> [ `Unix of Unix.error ] -> unitpp_error ppf e prints e on ppf.
val open_error : 'a result -> ('a, [> `Unix of Unix.error ]) Result.resultopen_error r allows to combine a closed unix error variant with other variants.
val error_to_msg : 'a result -> ('a, [> Rresult.R.msg ]) Result.resulterror_to_msg r converts unix errors in r to an error message.
Wrapping calls
val call : ('a -> 'b) -> 'a -> 'b resultcall f v is Ok (f v) but Unix.error.EINTR errors are catched and handled by retrying the call. Other errors e are catched aswell and returned as Error (`Unix e).
File system operations
val mkdir : Fpath.t -> Unix.file_perm -> unit resultmkdir is Unix.mkdir, see POSIX mkdir.
link is Unix.link, see POSIX link.
stat is Unix.unlink, POSIX unlink.
rename is Unix.rename, see POSIX rename.
val stat : Fpath.t -> Unix.stats resultstat is Unix.stat, see POSIX stat.
val lstat : Fpath.t -> Unix.stats resultlstat is Unix.lstat, see POSIX lstat.
truncate is Unix.truncate, see POSIX truncate.