-
Notifications
You must be signed in to change notification settings - Fork 24
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
Use apple's native ObjC APIs to produce the right paths #6
base: main
Are you sure you want to change the base?
Conversation
@jfro Thanks! I will look into it shortly! |
@jfro Thanks for your contribution – do you think it makes sense to expose |
@jfro Thanks! I'll merge this relatively soon. For future contributions, I'd like to kindly ask to avoid mixing code reformattings into PRs, it makes it harder to review and see what's going on. Cheers, Simon! |
re |
Ok, thanks! |
Looking back at it, I guess I lean more towards leaving it public since this is more of a sys wrapper around the system API so it's exposing it's functionality, though the higher level crate will unlikely use system domain at this time. If we really want we could hide it for now, just make the mask private & make |
Ok, thanks, I'll keep it public then! |
@jfro After some investigation, it appears that the translation of folders happens in the UI, so e. g.
At this point, this would be the remaining reason for this change ... could you expand on this? Is there some official documentation on the behavior? |
Yeah so iOS apps & macOS apps (macOS is optional or store apps) get a container folder that the app is allowed to read/write, where it can't access system & user folders without special permission first. So accessing say $HOME in a traditional manner will be rejected if not using say an open/save GUI panel to allow user to provide that permission. So typically for these apps to store various data like logs, config, etc they use the APIs I used in this PR. They've been around before sandbox, so they work in & outside of sandbox, returning the correct paths accordingly. So asking for a data dir you'd get ~/Library/Application Support on regular macOS app, or ~/Library/Containers/MyAppId/Library/Application Support Docs about the sandbox container found here: I've also wanted to introduce similar changes for Windows and its containers, but that API is harder to reach from Rust, so far seems to require winrt or the new windows crate which are heavy, specially with build times. |
@jfro Thank you, I'll read up on that! |
objc
on mac/ios side to use apple's APIs for acquiring various directories