What is OCaml's equivalent to "mkdir -p"?

Viewed 499

What is the OCaml equivalent of mkdir -p?

That is, create that directory and all missing parent directories, and don't fail if the directory already exists.

For example, Python 3 has os.makedirs(..., exist_ok=True).

Is there such a function in OCaml?

1 Answers

Janestreet core.unix provides Core.Unix.mkdir_p which does the -p of mkdir.

So there is not a strictly equivalent of python os.makedirs that require an extra flag but this one does the job.

Related