Skip to content

feat: creating and removing empty directories #1011

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

wassup05
Copy link
Contributor

@wassup05 wassup05 commented Jul 1, 2025

User facing functions added are

  • make_directory (path, mode, err) (mode argument only for Unix systems)
  • remove_directory (path, err)
  1. Both of them support relative paths and on Windows, paths involving either / or \.
  2. They bind to the CRT functions mkdir, rmdir, _mkdir, _rmdir on Unix and Windows respectively.
  3. A binding to strerror has been included as a private helper to provide helpful error messages.
  4. state_type is used for error handling.

Side note:
make_directory could have a logical argument recursive which would work like mkdir -p but that would require path manipulation especially dir_name from #999

Do let me know your thoughts.

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.

1 participant