Low-level untyped system operations
Exception raised when a computation in the current process fails.
with_tmp_dir fn executes
fn in a tempory directory
copy src dst copies
dst before the copy
if it is a link.
install ?exec src dst copies file
src as file
exec, make the resulting file executable (otherwise, look at the
permissions of the original file to decide).
Checks if a file is an executable (regular file with execution permission)
real_path p returns the real path associated to
expanded and relative paths become absolute.
read filename returns the contents of
write filename contents write
remove filename removes
filename. Works whether
a file or a directory
remove_file filename removes
filename. Works only for normal
files (or also at least for symlinks)
remove_dir filename removes
filename. Works only for
directory (not for symlinks or other files).
Change the current working directory
in_dir dir fn evaluates
fn in the directory
rec_files dir returns the list of all files in
Links behaving like directory are crossed.
Return the list of files in the current directory.
rec_dirs dir return the list list of all directories recursively
(going through symbolink links).
Return the list of directories in the current directory.
a command is a list of words
Test whether a command exists in the environment.
command cmd executes the command
cmd in the correct OPAM
commands cmds executes the commands
cmds in the correct OPAM
environment. It stops whenever one command fails unless
keep_going is set
true. In this case, the first error is re-raised at the end.
read_command_output cmd executes the command
cmd in the
correct OPAM environment and return the lines from stdout if the command
exists normally. If the command does not exist or if the command exited
with a non-empty exit-code, throw an error.
Test whether the file is an archive, by looking as its extension
extract filename dirname extracts the archive
dirname should not exists and
contain only one top-level directory.
extract_in filename dirname extracts the archive
dirname should already exists.
Create a directory. Do not fail if the directory already exist.
Acquires a lock on the given file. Retries 5 times max. By default, this is a write lock.
download compiler sources
Apply a patch file in the current directory.
Create a tempory file in ~/.opam/logs/<name>XXX
The separator character for the PATH variable