Module CUnix

System utilities
type physical_path = string
type load_path = physical_path list
val physical_path_of_string : string -> physical_path
val string_of_physical_path : physical_path -> string
val escaped_string_of_physical_path : physical_path -> string

Escape what has to be escaped (e.g. surround with quotes if with spaces)

val canonical_path_name : string -> string
val remove_path_dot : string -> string

Remove all initial "./" in a path

val strip_path : string -> string

If a path p starts with the current directory $PWD then strip_path p returns the sub-path relative to $PWD. Any leading "./" are also removed from the result.

val correct_path : string -> string -> string

correct_path f dir = dir/f if f is relative

val path_to_list : string -> string list
val make_suffix : string -> string -> string

make_suffix file suf catenate file with suf when file does not already end with suf.

val file_readable_p : string -> bool
Executing commands
val run_command : ?⁠hook:(bytes -> unit) -> string -> Unix.process_status * string
val sys_command : string -> string list -> Unix.process_status
val waitpid_non_intr : int -> Unix.process_status
val same_file : string -> string -> bool

Check if two file names refer to the same (existing) file

val mktemp_dir : ?⁠temp_dir:string -> string -> string -> string

Like Stdlib.Filename.temp_file but producing a directory.