-
Notifications
You must be signed in to change notification settings - Fork 45
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
Auto-create the dirs #120
Comments
If you fill a PR for it sure 👍 |
I initially had a thumbs up on the top post, but I just removed it again. We are currently working on adopting platformdirs to borgbackup and while dealing with the respective code, it became clear to me that:
|
Indeed. The way app_paths gave control was by exposing separate properties. Ex. user_data would auto-create while user_data_path would not. |
Hmm, is a separate property good enough considering the mode of the auto-created directory? |
In my cases, mode was never a consideration. Maybe it will become relevant, but hasn't yet. |
The basic use case of the default mode would suffice for my use cases as well, and I think this would be a very nice to have feature. A couple thoughts/questions:
|
Yeah, a PR with that effect would be accepted. |
Though instead of |
If I do I hope only the used directories will be created. It means that accessing a property will magically create a directory, but it doesn't seem too magical to me. Edit: Nevermind, this was already discussed above. Should have read more carefully... |
FYI, I finally started a branch for this. I need to write some tests then I'll open the PR. |
Thanks 👍 |
The app_paths project supports an additional interface (property) that will ensure the directory exists before returning it (alongside the classic interface where it's the caller's responsibility to create it). Having this interface is very convenient. Could platformdirs implement something similar?
The text was updated successfully, but these errors were encountered: