Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parents option to file.mkdir. #3601

Merged
merged 5 commits into from
Dec 21, 2023
Merged

Add parents option to file.mkdir. #3601

merged 5 commits into from
Dec 21, 2023

Conversation

smimram
Copy link
Member

@smimram smimram commented Dec 20, 2023

Fixes #3600.

@smimram smimram requested a review from toots December 20, 2023 08:05
Copy link
Member

@toots toots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Two comments.

recmkdir (Filename.dirname dir);
Unix.mkdir dir perms)
in
if parents then recmkdir dir else Unix.mkdir dir perms;
Lang.unit
with _ -> Lang.unit)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we raise a runtime error instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the simple behavior for now.

src/core/builtins/builtins_files.ml Show resolved Hide resolved
@smimram smimram added this pull request to the merge queue Dec 21, 2023
Merged via the queue into main with commit 9b7cb57 Dec 21, 2023
26 checks passed
@smimram smimram deleted the mkdir-p branch December 21, 2023 09:47
@scottgrobinson
Copy link

Hey @toots @smimram - Sorry for the tag on this. Any chance we can look at merging this into 2.2.5? It missed 2.2.4 (I think?)
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

file.mkdir to support "recursive" dir creation / parent dir creation
3 participants