vog
vog

Reputation: 25627

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

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?

Upvotes: 3

Views: 721

Answers (1)

Pierre G.
Pierre G.

Reputation: 4431

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.

Upvotes: 5

Related Questions